当前位置:网站首页>How to quickly change the database name in MySQL
How to quickly change the database name in MySQL
2022-06-29 04:22:00 【Yisu cloud】
MySQL How to quickly change the database name in
This article mainly explains “MySQL How to quickly change the database name in ”, Interested friends might as well come and have a look . The method introduced in this paper is simple and fast , Practical . Now let Xiaobian take you to learn “MySQL How to quickly change the database name in ” Well !

1、 New database centos_old.
mysql > create database centos_old;
2、 Use select concat Put together all rename table The sentence of .
mysql -uroot -p -e "select concat('rename table centos.',table_name,' to centos_old.',table_name,';') from information_schema.TABLES where TABLE_SCHEMA='centos';" > rename_mysql_name.sqlopen rename_mysql_name.sql, Delete the first line .
rename_mysql_name.sql The content is about :
rename table centos.wp_commentmeta to centos_old.wp_commentmeta; rename table centos.wp_comments to centos_old.wp_comments; rename table centos.wp_forum_forums to centos_old.wp_forum_forums; rename table centos.wp_forum_groups to centos_old.wp_forum_groups; rename table centos.wp_forum_posts to centos_old.wp_forum_posts; rename table centos.wp_forum_threads to centos_old.wp_forum_threads; rename table centos.wp_forum_usergroup2user to centos_old.wp_forum_usergroup2user; rename table centos.wp_forum_usergroups to centos_old.wp_forum_usergroups; rename table centos.wp_links to centos_old.wp_links; rename table centos.wp_options to centos_old.wp_options; rename table centos.wp_postmeta to centos_old.wp_postmeta; rename table centos.wp_posts to centos_old.wp_posts; rename table centos.wp_term_relationships to centos_old.wp_term_relationships; rename table centos.wp_term_taxonomy to centos_old.wp_term_taxonomy; rename table centos.wp_terms to centos_old.wp_terms; rename table centos.wp_usermeta to centos_old.wp_usermeta; rename table centos.wp_users to centos_old.wp_users;
3、 perform rename sentence
mysql -uroot -p
That's it centos The database name is changed to centos_old The operation of .
Here we are , I'm sure you're right “MySQL How to quickly change the database name in ” Have a deeper understanding of , You might as well put it into practice ! This is the Yisu cloud website , For more relevant contents, you can enter the relevant channels for inquiry , Pay attention to our , Continue to learn !
边栏推荐
- Practical part: solving the function conflict between swagger and user-defined parameter parser
- 【HackTheBox】dancing(SMB)
- Apifox : 不仅是Api调试工具,更是开发团队的协作神器
- 从零到一,教你搭建「以文搜图」搜索服务(一)
- 1019 digital black hole
- [C language] start a thread
- Ansible最佳实践之Playbook不同上下文提权Demo
- 访问数据库时出现错误
- SQL two columns become multi row filter display
- Does cdc2.2.1 not support postgresql14.1? Based on the pgbouncer connection mode, with 5433
猜你喜欢
随机推荐
Ling Jing thinks about her own way
Build a simple website by yourself
从零到一,教你搭建「以文搜图」搜索服务(一)
Sword finger offer II 040 Largest rectangle in matrix
What is the dry goods microservice architecture? What are the advantages and disadvantages?
选对学校,专科也能进华为~早知道就好了
[new function] ambire wallet integrates Metis network
043. (2.12) what will happen if you become enlightened?
Hot renewal process
【HackTheBox】dancing(SMB)
Baidu AI Cloud service grid product CSM release 𞓜 hot public beta
【HackTheBox】dancing(SMB)
I came from a major, so I didn't want to outsource
From zero to one, I will teach you to build a "search by text and map" search service (I)
【新功能】Ambire 钱包集成了 Metis 网络
JVM_ 16_ Garbage collector
Using assetstudio/unitystudio uabe, etc
请问大佬,Oracle CDC报错 Call snapshotState on closed sou
Ansible best practices playbook different context rights raising demo
ECS 四 Sync Point、Write Group、Version Number









