mysql数据库重命名语句分享
程序员文章站
2024-02-28 09:25:34
复制代码 代码如下:create database `ct` default character set utf8 collate utf8_general_ci;&nbs...
复制代码 代码如下:
create database `ct` default character set utf8 collate utf8_general_ci;
rename table `51cola`.`commentmeta`
to `ct`.`commentmeta`;
rename table `51cola`.`comments`
to `ct`.`comments`;
rename table `51cola`.`customcontactforms_fields`
to `ct`.`customcontactforms_fields`;
rename table `51cola`.`customcontactforms_field_options`
to `ct`.`customcontactforms_field_options`;
rename table `51cola`.`customcontactforms_forms`
to `ct`.`customcontactforms_forms`;
rename table `51cola`.`customcontactforms_styles`
to `ct`.`customcontactforms_styles`;
rename table `51cola`.`customcontactforms_user_data`
to `ct`.`customcontactforms_user_data`;
rename table `51cola`.`links`
to `ct`.`links`;
rename table `51cola`.`options`
to `ct`.`options`;
rename table `51cola`.`postmeta`
to `ct`.`postmeta`;
rename table `51cola`.`posts`
to `ct`.`posts`;
rename table `51cola`.`terms`
to `ct`.`terms`;
rename table `51cola`.`term_relationships`
to `ct`.`term_relationships`;
rename table `51cola`.`term_taxonomy`
to `ct`.`term_taxonomy`;
rename table `51cola`.`usermeta`
to `ct`.`usermeta`;
rename table `51cola`.`users`
to `ct`.`users`;
drop database `51cola`;