I am using MySQL Workbench 5.2.28 for designing my database schema. I need to insert default data into some tables which can be done using the "Inserts" tab. However, it seems like it only allows entering data manu开发者_如何转开发ally, one row at a time. I have an OUTFILE with several hundred rows that I would like to insert.
Is this possible with MySQL Workbench? Would creating separate MySQL scripts for importing default data be a better approach?
I am now using separate sql scripts for inserting my data as there doesn't seem to be an easy way to add bulk inserts to MySQL workbench.
Generate CSV (quoted if you have comas in values) in Excel for example, then just copy/paste all rows into workbench via 'inserts' tab for each table in model. Works with Workbench version 5.2.40.
In the MySQL Workbench Version 6.2 you will find a Import Button which alows you to Import Inserts from a CSV File with "," as delemiter.
You are right there is no way I know doing this automatically. The only thing you can do is to generate all your inserts scripts in a single time by doing a forward engeniering and then by copying the insert statements at the end of the generated script (You must check the option "Generate INSERT statements").
精彩评论