MySQL Workbench Attachments

I am using MySQL Workbench 5.2.28 to develop my database schema. I need to insert default data into some tables that can be done using the Insert tab. However, it seems that it allows you to enter data manually, one line at a time. I have an OUTFILE with a few hundred lines that I would like to insert.

Is this possible with MySQL Workbench? Would there be a better approach to creating separate MySQL scripts to import default data?

+6
source share
4 answers

Now I use separate sql scripts to insert my data, as there seems to be no easy way to add bulk inserts to MySQL Workbench.

+5
source

Create a CSV (for example, if you have coma in the values) in Excel, and then just copy / paste all the rows into the workbench through the "inserts" tab for each table in the model. Works with Workbench version 5.2.40.

+3
source

In MySQL Workbench version 6.2, you will find an import button that allows you to import inserts from a CSV file using "," as delemiter.

+2
source

You are right, I do not know how to do this automatically. The only thing you can do is to generate all your insert scripts at a time by pre-compiling and then copying the insert statements at the end of the generated script (you should check the "Generate INSERT statements" option).

0
source

Source: https://habr.com/ru/post/890055/


All Articles