Alex Rivera | Logout

How to simulate "MYSQL has gone away" error?

Asked 2010-05-08T09:07:35.910
9

I'm running lots of cron job and once in a while there is a MYSQL has gone away error.

I've now written some code to handle the error, but how do I simulate the error on my localhost so that the code can be tested thoroughly?

Edit
Report

1 Answer

11

Kill a long-running thread.

See: KILL syntax

The documentation about that error also lists different causes, so you could emulate some of them (eg: change the timeout to be very low, etc).

answered 2010-05-08T09:08:58.643

Your Answer