Mysql – Datadump Fails with Exit Code 1

importMySQL

I am in mySQL Workbench trying to import a datadump in a .sql file (generated by phpMyAdmin) into mySQL (server administration>data dump>import from disk), and it keeps failing with the following output:

10:47:14 Restoring C:\myfolder\localhost.sql ( )

Running: mysql.exe –host=127.0.0.1 –user=root –password=xxxxxxx –port=3306 –comments< C:\myfolder\localhost.sql

Operation failed with exitcode 1

10:47:15 Import of C:\myfolder\localhost.sql has finished

When I go view the schema, it looks like it imported 6 tables (of 50ish) and almost no data at all.

Errata:

  1. There don't appear to be any contraints or relations ships. All the data is being added via several DROP TABLE IF EXISTS; CREATE TABLE; INSERT INTO series with hard-coded values.
  2. The file has a substantial number of large chunks. And the file itself is over 400 MB.
  3. When I manually checked to see if the effect of any clause of the file is working, I discovered it is getting hung up on the INSERT INTO sql with the VERY large hardcoded chunks. Not sure if that's significant or not?
  4. I also noticed that some of the chunks have a length greater than 32768 is there an upperbound on chunk length?

Best Answer

I didn't get all the way down to root cause on this, but I found the source of the problem. I had one very large table of attachments being written with INSERT VALUES. I removed this table and then tried to just run as a SQL script. But I got a new error (which escapes me right now.) Googling the new error told me the script was too long to run without increasing the max_allowed_packet variable. Turning this up to a really large number allowed the script to run.