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.

2
  • 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: stackoverflow.com/questions/14726789/… Commented Nov 17, 2019 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! Commented Nov 17, 2019 at 15:16

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.