Home  >  Article  >  Database  >  How to modify the database name in navicat

How to modify the database name in navicat

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-08-05 15:22:049527browse

How to modify the database name in navicat

How to change the database name in navicat?

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

2. Right-click on database A -> Dump SQL file -> Structure and data; Right-click on database B -> Run SQL file.

Execution speed: slowest.

Related recommendations: "Navicat for mysql graphic tutorial"

3. Select the menu bar: Tools-> Data Transfer (the source library is A , the target database is B) –> Start, after the transfer is completed, refresh database B.

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

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

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

4. Rename all tables in database A. The two libraries must be on the same server. (Recommended)

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

select CONCAT('RENAME TABLE ',TABLE_SCHEMA,'.',TABLE_NAME,' to ', 'B.',TABLE_NAME,';') 
from information_schema.`TABLES` where TABLE_SCHEMA = 'A';

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

The above is the detailed content of How to modify the database name in navicat. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what is navicatNext article:what is navicat