mysql数据库重命名语句分享

时间:2021-05-24

复制代码 代码如下:
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`;

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章