0

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.

Alan
  • 619
  • 6
  • 19
  • 1
    And YOU need to have a look at this, on behalf of your client? what is this paying? But seriously, this has been asked before: https://stackoverflow.com/questions/14726789/how-can-i-change-the-default-mysql-connection-timeout-when-connecting-through-py – Luuk Nov 17 '19 at 15:10
  • Yeah...long story...the main database guy at the client is on a cruise holiday and can't be reached for the next two weeks. Not ideal! – Alan Nov 17 '19 at 15:16

1 Answers1

1

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
WEBjuju
  • 5,797
  • 4
  • 27
  • 36
  • 1
    Thank you. Editing the SQL file to place that line of code at the top didn't work, sadly, but I read the link that you gave and I was able to get everything working by creating a my.ini file (didn't exist previously) in the relevant directory and filling it with the various commands listed by Santosh Prasad about a quarter of the way down the page. – Alan Nov 17 '19 at 18:39