Home > MySQL > Error 2006: MySQL Server has gone away.

Error 2006: MySQL Server has gone away.

Problem: Getting this error in my python script

Traceback (most recent call last):
File “my_application.py”, line 202, in
main()
File “my_application.py”, line 186, in main
traceback.format_exec())
AttributeError: ‘module’ object has no attribute ‘format_exec’

When I check my application logs I have

OperationalError: (2006, ‘MySQL server has gone away’)

Solution:

Increase the wait_timeout value in /etc/mysql/my.cnf.
In my case I changed it from 6 to 600

wait_timeout = 600

As root restart the mysql server. /etc/init.d/mysql restart

More information on this error (for mysql 5.0) can be found here. http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: