I am not sure why this started to show last few days. It only happens when i try to edit content type (admin/structure/types/content_type_name) or when i want to add new content type.

Going back in browser and clearing cache moves the error away and i am able to edit or create content but the error still shows on the bottom of the page.
I can work for few minutes without interuption but then again it starts showing.

Website is live, but i have not noticed that it happens to users (anonymous or loged in), or that it breaks any part the website except adding/editing content type. (manage fields, manage display always work without errors, its just the edit content page).

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 148926721856f8ef83caa1a9.09501995 ) in lock_release_all() (line 269 of /var/www/html/includes/lock.inc).

  • In which server you site is host? – vgoradiya Mar 28 '16 at 9:05
  • CentOS Linux release 7.2.1511 – Azz Kawa Mar 28 '16 at 9:07

Drupal doesn't connect to MySQL until the first query is sent. A request almost never takes more than a second, and usually less than half a second. If your MySQL server is timing out in that amount of time it means MySQL is misconfigured.

Please verify that you have a reasonable wait_timeout. I suspect simply increasing that will solve the problem.

This has to do with maximum allowed packet size in MySQL. To solve, this edit my.cnf: max_allowed_packet=100M and restart MySQL.


All you need to increase to max allowed packet. You are using CentOS, which need to configure as below within command line.

nano /etc/my.cnf
max_allowed_packet = 32M
service mysqld restart
  • Ok, i will tell my admin to do that. Can i increase to more then 32M to skip some possible future errors ? I have 4GB total. – Azz Kawa Mar 28 '16 at 10:35
  • When a MySQL client or the mysqld server receives a packet bigger than max_allowed_packet will through this error.The largest possible packet that can be transmitted to or from a MySQL 5.5 server or client is 1GB. – vgoradiya Mar 28 '16 at 10:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.