0

I have mysql server going away on a simple select query, the error is:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was: SELECT `main_table`.* FROM `sales_flat_order` AS `main_table` WHERE (`increment_id` LIKE '%0005254')

This query is cron-scheduled and executed every 5 mins. If I restart the mysql server, the query is executing normally for a day and then starts crashing again.

I thought it's RAM-related, but I have plenty of RAM on the server:

free

The MySql version is 5.7.17 on Ubuntu 14.04.5 LTS

There are no errors neither in /var/log/mysql/errors.log nor in syslog

Some other configs:

max_allowed_packet = 256M
innodb_buffer_pool_size = 2G

Do you have any idea what it can be?

super.t
  • 2,526
  • 7
  • 32
  • 51
  • possible duplicate of [http://stackoverflow.com/questions/18486023/sqlstatehy000-general-error-2006-mysql-server-has-gone-away-on-running-cron] – Munish Kumar Jan 17 '17 at 08:57

1 Answers1

0

Check the open_files_limit

  SHOW VARIABLES LIKE 'open%';

If less then increase it and check. Also would like to add max_allowed_packet

SET GLOBAL max_allowed_packet='figure more then existing one'.
Nishant Nair
  • 1,999
  • 1
  • 13
  • 18