Below I give you the introduction of the database in MySQL to prompt MySQL server has gone away problem resolution method, if you encounter MySQL prompt MySQL server has gone away error we can enter the reference.
As some small scripts rarely error, but recently imported a 10+m SQL script, but repeated the error:
Error occured at:2014-03-24 11:42:24
Line no.:85
Error Code:2006-mysql server has gone away
Finally found the reason, originally is MySQL imports the large amount of data when the default allows the largest packet, so the prompt 2006-mysql server has gone away
Then found MY.CNF, in [Mysqld] joined:
The code is as follows |
Copy Code |
max_allowed_packet=300m wait_timeout=200000 Interactive_timeout = 200000 |
The maximum allowable packet 300M, wait timeout/activity expires 200,000 seconds often, restart MySQL
The code is as follows |
Copy Code |
[Email protected] 20140323]#/etc/init.d/mysqld restart Shutting down MySQL .... success! Starting MySQL. success! |
Re-import again, everything is OK!
MySQL Import SQL script error: 2006-mysql server has gone away