1

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was.After placing order getting error

i am getting error below error after placing order:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was: SELECT COUNT(*) FROM `sales_flat_order` AS `main_table` WHERE (main_table.customer_id = '12137') AND (state IN('new', 'processing', 'complete', 'closed', 'canceled', 'holded', 'payment_review')

enter image description here

How can I fix this error.

1

This means, that your code waits to long before sending the statement to the SQL server (or it crashed).

  • Check dmesg whether your SQL server or client crashed (if yes, get more ram ore reduce memory usage)
  • if it didn't, increase wait_timeout in /etc/mysql/my.cnf as temporary fix
  • analyse your code with a profiler like tideways or blackfire for permanent fix

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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