Search code examples
mysqlcsvmysql-workbenchexport-to-csv

Running a MySQL Script - with zero knowledge


A client has just supplied me with two long files which are (apparently) scripts that I can run in MySQL to generate a bunch of database tables.

I've installed MySQL (+ workbench) on my PC. From within the Workbench environment I found "run SQL script" under the File menu so I went with that and tried to run the two script files I have. They both fell over partway though giving me error messages:

Finished executing script
ERROR 2006 (HY000) at line 1930: MySQL server has gone away
Operation failed with exitcode 1

and

Finished executing script
ERROR 2006 (HY000) at line 20201: MySQL server has gone away
Operation failed with exitcode 1

I can however see two schemas, both of which contain a bunch of tables, etc. (some of which are populated) so it seems to have been a partial success at least.

Can anyway suggest what might be wrong please?

Thank you.


Solution

  • I can point you at a solved example on stackoverflow for this MySQL error, but the simplest solution is to edit your sql file(s) placing this query at the top:

    set SESSION max_allowed_packet=64*1024*1024