Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Workbench - How to clone a database on the same server with different name?

Tags:

I am using MYSQL Workbench and I want to clone a database on the same server with different name. It should duplicate the all the tables structure and data into the new database.

I know the usual way is probably using data export to generate a sql script of the database and then run the script on the new database but I encounter some issues with it.

Anyway, is there any better way or easier way to do so?

like image 379
Daredevil Avatar asked Mar 05 '19 06:03

Daredevil


People also ask

How do I change my database name in workbench?

To change the name of the default schema, double-click the schema tab. This opens a schema editor window docked at the bottom of the application. To undock or redock this window, double-click anywhere in the editor title bar. To rename the schema, use the field labeled Name.

Can a MySQL server have multiple databases?

Within an Azure Database for MySQL server, you can create one or multiple databases. You can opt to create a single database per server to use all the resources or to create multiple databases to share the resources.


1 Answers

You can use migration wizard from MySQL Workbench. Just choose the same local connection in both source and target selection, then change schema name on manual editing step. If nothing appears on manual editing step click next and the source and targets will appear. Click slowly on the source database name and edit to the correct name. Go thorough to the end and voilà - you have two identical databases with different names. Note you must have created the target database already and granted permissions to it for the MySQL Workbench user.

like image 191
Milosz Bodzek Avatar answered Sep 21 '22 13:09

Milosz Bodzek