1

I have an old MySql dump file (xyz.sql) that I want to import to a model in MySql Workbench.

I was able to do a Reverse Engineering of the file which created the schema and all the tables. Unfortunately it didn't import the data which is important.

So all tables are empty under the "Inserts" tab.

How can I import the data from the file into the tables or import the complete file schema + data in 1 step.

I use MySql Workbench 8.0.27

Thanks

Flemming Lemche
  • 169
  • 1
  • 3
  • 23

1 Answers1

1

Based on a no longer available answer on another website:

  1. Open the connection you work with under MySQL Connections
  2. On the menu, click:
    • Server > Data Import (Newer versions, e.g. 8.0)
    • Data Import / Restore (Older versions)
  3. Select Import from Self-Contained File
  4. Click … or . and locate your .sql file
  5. Under Default Target Schema select the database where you want this import to go
  6. Click Start Import at the bottom (you might have to resize the window in smaller screens)

Terminal/shell alternative

Import data into table using:

mysql -u USERNAME -p DBNAME < path/example.sql

Commonly USERNAME is root and use --force or -f if a 3554 innodb_index_stats error pops up.

CPHPython
  • 12,379
  • 5
  • 59
  • 71
Stryhx
  • 40
  • 1
  • 7