欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mysql数据库重命名语句分享

程序员文章站 2024-02-26 09:04:58
复制代码 代码如下: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`;