Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of modifying Database name by navicat

2025-03-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you the method of navicat to modify the name of the database, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

There is a database named A that needs to be modified to B. The name of the database cannot be modified by F2 in Navicat. We must create a new library and name it B. The following four ways can achieve your goal. If there are remote tables and permission settings in the database, the fourth method is recommended.

Recommended tutorial: navicat Picture and text tutorial

1. If the tables and settings in database An are relatively simple, copy all the tables in database A directly and paste them into database B.

2. Right-click-> dump SQL file-> structure and data on A database, and right-click-> run SQL file on B database.

Execution speed: slowest.

3. Select the menu bar: tools-> data transfer (source database A, target database B)-> start. After the transfer is complete, refresh database B.

If there is a remote table in database A, the operation will report an error with the error message:

[Err] [Dtf] 1432-server name:''doesn't exist!

Therefore, you need to copy the DDL statements of all remote tables in the database into a txt file, and then delete all remote tables in the database. Perform this operation again. Finally, execute all the DDL statements saved in the txt file on the B library once. Realization principle: copy and paste. Execution speed: medium.

4. Rename all tables in database An and the two libraries need to be on the same server. (recommended)

Execute the following SQL statement, and the query result is a collection of sql scripts for the renamed table:

Select CONCAT ('RENAME TABLE', TABLE_SCHEMA,'.',TABLE_NAME,' to','B.) from information_ schema.`TABLES` where TABLE_SCHEMA ='A'

Copy all the result rows and execute them as sql scripts. Execution speed: the fastest.

Note: in order to prevent unknown accidents, please back up your database before performing the operation!

The above is all the contents of this article "how to change the database name by navicat". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report