简体   繁体   中英

Is it possible to preload data by default, to the target database from MySQL Workbench?

There are certain tables, that does not often change:

  • Country (ID / Name / Abbreviations)
  • IPs by Countries (ID / IP Range)

During the development, every time I modify something on the database I have to preload these tables manually into the newly created database.

Is there any way to query these datas automatically to the tables at every Forward Engineer process in MySQL Workbench?

Each table in a MySQL Workbench model file has a section called "Inserts". Open a table in the table editor and click the tab labeled "Inserts". There you can add as many records as you wish and this data is applied when you forward engineer your model.

you can simply create a import/export script with the tables you want or even the whole database. eg:

mysqldump -hHOST_FROM -u -p database_name table_name --no-create-db --no-create-info mydb | mysql -hHOST_TO -u -p database_name

BTW: "I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it" - Bill Gates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM