How to import data (inserts) to a template (.MWB) in the workbench?

0

In the workbench I can insert data in the model individually by table of the form below, then when using the forward engineer just enable the Create Inserts in the SQL file that it generates, follows:

But to do this for hundreds of tables is very costly (export from server to CSV and then import, one by one), my question is, is there a way to import data from a mysql server to a workbench model? if it would be the same template that is physically on the server.

    
asked by anonymous 29.09.2015 / 23:00

1 answer

0

It is possible to perform a dump of your database by the workbench you have to click the right button on the base and ask to export but this process is time consuming.

I recommend using command line: You said that the table structure is ok, so it would only be the data then on the server in the shell command if it is ubuntu you put this command

mysqldump -h localhost -u user -ppassword --no-create-info banco > minhabase.sql

If you want the queries to create the tables and etc would be:

mysqldump -h localhost -u user -ppassword banco > minhabase.sql

To restore you do so

mysql -h localhost -u user -ppassword banco < minhabase.sql

To do these commands in windows, one must enter MSDOS "Ctrl + R -> 'cmd' enter" Navigate to where your mysql is, enter the bin folder. Ready now you can do the commands.

    
29.09.2015 / 23:05