Drupal PDOException: SQLSTATE[HY000] error solution

Sometimes Drupal throws this error "PDOException: SQLSTATE[HY000]:2006 MySQL server has gone away..". This is due to low max allowed packet settings of mysql.

Find your mysql config file by using whereis.

whereis my.cnf

Edit the configuration and include the below line

max_allowed_packet=100M

Mysql my.cnf file

Thats it. Restart the service by issuing service mysql restart and try gain. There wont be any errors from now on :)

P.S: In case you are in shared hosting and cannot change this setting, refer https://drupal.org/node/1281408 to apply patch to work with low max_allowed_packet

About This Blog

There is something for everyone. !! A tech blog on various topics. Let it be devops, programming etc; we have it all covered here in layman terms :)

Total Pageviews

Back to TOP