mysql数据库重命名语句

整理了一些 mysql数据库重命名语句,语句中的数据库表前缀换成自己的即可。
 
代码:
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`;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值