Getting MYSQL Error: “Error Code: 2006 – MySQL server has gone away”

mysql-logo-1

By default the Timeout directive is set to 300 seconds.

If you want to increase or decrease it by finding the Timeout directive in

‘httpd.conf’ file. (/usr/local/apache).

 

Investigation shows many solutions correctly talking about setting the max_allowed_packet and wait_timeout for mysql in my.cnf; small addendum that the default install of mysql on mac osx doesn’t appear to include this file. You may first need to create it at /etc/my.cnf (this is only an issue if you’re using the default install of mysql instead of a mamp stack or similar)

contents of /etc/my.cnf that corrected this issue for me below:

[mysqld] max_allowed_packet= 64M
wait_timeout= 6000

Comments

comments

Καλέστε μας