F21
F21

Reputation: 33391

MySQL WorkBench with inserts from external source

I am using MySQL workbench 5.2.38 (latest) to design my database. I am using NaviCat to manage the database server.

I have designed the database, but would like to be able to insert some default data. MySQL WorkBench comes with an "Inserts" table to insert the table data. However, it is very tedious as each entry must be typed in manually. I found this question, but the solution the asker came up with was to just use a seperate script.

In my case, I would like to import the data from the live database or perhaps some other external file.

I have tried using Database->Synchronize Model and attempted to synchronize data from the database back to the model, but for some reason, workbench just crashes, or says it is completed successfully, but the data never shows up in my model.

Has anyone successfully got inserts from an external source imported into a workbench model? If you have built large database driven applications which ships with a lot of default data (inserts), I would love to hear how you dealt with the default inserts in a managable way as well :)

Upvotes: 1

Views: 1974

Answers (2)

Piaf
Piaf

Reputation: 137

Generate CSV (quoted if you have comas in values) in Excel for example, than just copy/paste all rows into workbench via 'inserts' tab for each table in model. Works with Workbench version 5.2.40.

Upvotes: 1

F21
F21

Reputation: 33391

I couldn't find a way to deal with the mass inserts in an easy way, so I ended up just writing a PHP script and using ORM.

At least this way, it is much easier to make changes to the default data.

If someone can some up with a better solution, I will mark that as correct.

Upvotes: 0

Related Questions