Home> Database> navicat> body text

How to modify the database name in navicat

爱喝马黛茶的安东尼
Release: 2019-08-05 15:22:04
Original
9443 people have browsed it

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!
Copy after login

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 after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!