当前位置:网站首页>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 !
边栏推荐
- 使用AssetStudio/UnityStudio UABE等
- Has my future been considered in the cloud native development route?
- If I hadn't talked to Ali P7, I wouldn't know I was a mallet
- 在命令行登录mysql数据库以及查看版本号
- [laravel series 8] out of the world of laravel
- 访问数据库时出现错误
- Seattention channel attention mechanism
- The great gods take connections from the MySQL connection pool in the open of the rich function. The initialization of the connection pool is 20. If the parallelism of the rich function is 1
- Blue Bridge Cup DFS (I)
- [new function] ambire wallet integrates Metis network
猜你喜欢

从零到一,教你搭建「以文搜图」搜索服务(一)

Build a simple website by yourself

【HackTheBox】dancing(SMB)

Redis cache penetration, cache breakdown, cache avalanche

Implementation of b+ tree index based on xlsx

直播预约|AWS Data Everywhere 系列活动

Inftnews | metauniverse technology will bring a new shopping experience
![[C language] address of stack memory associated with local variable 'num' returned](/img/34/f8cf86a18ed461b25073b740dece45.png)
[C language] address of stack memory associated with local variable 'num' returned

If I hadn't talked to Ali P7, I wouldn't know I was a mallet

JSX的基本使用
随机推荐
How to keep database and cache consistent
Canoe- how to parse messages and display information in the trace window (use of program node and structure type system variables)
JDBC learning
树莓派用VNC Viewer方式远程连接
How sqlserver queries and removes results with null fields in the whole column
SqlServer如何查询除去整列字段为null的结果
MySQL column to row conversion without Union
1015 theory of virtue and talent
Rapid development project -vscode plug-in
Baidu AI Cloud service grid product CSM release 𞓜 hot public beta
What is the dry goods microservice architecture? What are the advantages and disadvantages?
Apifox: it is not only an API debugging tool, but also a collaboration artifact of the development team
HCIE-Security Day41:理论学习:信息收集与网络探测
Remote connection of raspberry pie in VNC Viewer Mode
Lua protobuff Emmy Lua wheel
Why are you a test / development programmer? Can you recall
Analysis of moudo Network Library
Error accessing database
Call snapstateon closed sou from Oracle CDC
[C language] address of stack memory associated with local variable 'num' returned