Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying/Cloning database in Datagrip(MySQL)

Please do not close this question! My problem is simple and can be answered, I just do not have much experience with Datagrip. All I want to know is, how I can copy a schema to another schema I've created, essentially creating a clone of the original. For some reason my CMD prompt is not set for MySQL, there has got to be an easy way to do this within the Datagrip user interface, someone please help, thank you!

like image 366
Jugo Lugara Avatar asked Apr 29 '20 23:04

Jugo Lugara


People also ask

How do I copy a database in DataGrip?

Right-click a table and select Copy Table to… ( F5 ). In the Choose Target dialog, type the name of a schema in which you want to create a copy. In the Import <table_name> Table dialog, ensure that mappings are correct and click Import.

How do you duplicate a database?

Expand Databases, right-click the desired database, point to Tasks, and then select Copy Database... If the Welcome to the Copy Database Wizard splash page appears, select Next. Select a Source Server page: Specify the server with the database to move or copy. Select the authentication method.


1 Answers

There can be two ways.

  1. Reliable and with data, but requires my_sqldump. Context menu of the schema -> Export with mysql_dump. After that, on your new schema go to Context menu -> Restore with mysql_dump.

enter image description here

  1. Works if your schema does not contain some very specific objects: LOGFILE GROUP, SERVER, SPATIAL REFERENCE SYSTEM, TABLESPACE. And with no data. Go to the context menu of the schema -> Sql Scripts -> SQL generator. There you will see the script to create the schema from scratch. Just run it on your new schema.

enter image description here

like image 104
moscas Avatar answered Sep 19 '22 15:09

moscas