There is a database named A that needs to be modified to B. In Navicat, you cannot press F2 to modify the name of the database. We must create a new library and name it B. The following 4 ways can achieve your goals. If there are remote tables and permission settings in the database, the fourth method is recommended.
Recommended tutorial: navicat graphic tutorial
## 1. If the tables and settings in database A It's 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.3. Select the menu bar: Tools -> Data Transfer (source database is A, 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!
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';
Note: In order to prevent unknown accidents from happening, please back up your database before performing the operation! !
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!