当前位置:网站首页>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 !
边栏推荐
- PostgreSQL has a cross database references are not implemented bug
- 1017 A除以B分
- Cucumber test practice
- 直播预约|AWS Data Everywhere 系列活动
- On June 27, 2022, I have the right to choose the journey of the summer vacation.
- From zero to one, I will teach you to build a "search by text and map" search service (I)
- Is the increased life insurance off the shelf? What additional life insurance products are available now?
- 我的创作纪念日
- Anaconda's own Spyder editor starts with an error
- 1019 数字黑洞
猜你喜欢

LabVIEW displays Unicode characters

为什么说测试岗位是巨坑?8年测试人告诉你千万别上当

I came from a major, so I didn't want to outsource

Rapid development project -vscode plug-in

Establishment of small and medium-sized enterprise network

The second meeting of the Second Council of Euler open source community was held, and Xinhua III, hyperfusion and Godson Zhongke became members of the Council

Here comes Wi Fi 7. How strong is it?

Remediation for Unsafe Cryptographic Encryption

Basic use of JSX

树莓派用VNC Viewer方式远程连接
随机推荐
The virtual machine MySQL cannot be connected to the local computer
lua-protobuff emmy-lua 轮子
Remediation for Unsafe Cryptographic Encryption
Libuv library overview and comparison of libevent, libev and libuv (Reprint)
不使用union实现Mysql 列转行
c语言 --- 分支结构
大神们 在富函数的open中从mysql连接池里取连接 连接池初始化是20个 如果富函数的并行度是1
CTO and programmer were both sentenced because the crawler was out of control!
Ask a simple question about SQL
【HackTheBox】dancing(SMB)
Logstash starts too slowly or even gets stuck
MySQL column to row conversion without Union
基于可变参模板实现的线程池
Runtimeerror in yolox: dataloader worker (PID (s) 17724, 1364, 18928) exited unexpectedly
New listing of operation light 3.0 -- a sincere work of self subversion across the times
1019 数字黑洞
1016 部分A+B
The five levels of making money, which level are you on?
Is the interviewer too difficult to serve? A try catch asks so many tricks
Developer scheme · environmental monitoring equipment (Xiaoxiong school IOT development board) connected to graffiti IOT development platform