当前位置:网站首页>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 !
边栏推荐
- Airflow2.2.3 + efficiency + MySQL 8 build a robust distributed scheduling cluster
- Hi, my technology forum is online!
- JDBC man Han building code
- 我的创作纪念日
- 直播预约|AWS Data Everywhere 系列活动
- Libuv library overview and comparison of libevent, libev and libuv (Reprint)
- Binary tree serialization and deserialization (leetcode (difficult))
- webassembly学习-动态链接
- Analysis of moudo Network Library
- 1017 a divided by B
猜你喜欢

Rapid development project -vscode plug-in

Here comes Wi Fi 7. How strong is it?

【HackTheBox】dancing(SMB)

Remediation for Unsafe Cryptographic Encryption

快速开发项目-VScode插件

1018 hammer scissors cloth

Blue Bridge Cup DFS (I)

Mécanisme d'attention du canal de fixation

如何创建 robots.txt 文件?

Cloud native weekly | grafana 9 was officially released; The Chinese version of cloud native vocabulary is now online
随机推荐
Has my future been considered in the cloud native development route?
Mécanisme d'attention du canal de fixation
IDEA修改jvm内存
1015 德才论
The virtual machine MySQL cannot be connected to the local computer
From zero to one, I will teach you to build a "search by text and map" search service (I)
源代码防泄露技术种类浅析
Redis 缓存穿透、缓存击穿、缓存雪崩
Nuxt - 每个页面单独设置 SEO 相关标签及网页标题、图标等(页面配置 head)
String differences between different creation methods
Ask a simple question about SQL
Airflow2.2.3 + efficiency + MySQL 8 build a robust distributed scheduling cluster
自己动手搭建一个简单的网站
MySQL column to row conversion without Union
Pytorch read / write file
The last week! Summary of pre competition preparation for digital model American Games
1019 数字黑洞
iNFTnews | 元宇宙技术将带来全新的购物体验
1017 a divided by B
Anaconda自带的Spyder编辑器启动报错问题