• : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.

Drupal : Problems with Database Timeout Query

Have you ever found this error in your site ?

[27-Jul-2007 06:38:19] PHP Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, severity, link,
location, referer, hostname, timestamp) VALUES (0, 'php', 'MySQL server
has gone away\nquery: SELECT data, created, headers, expire FROM cache
WHERE cid = 'menu:0:en' in /home/hamburgi/public_html/orvwatch/includes/database.mysql.inc on line
121.', 2, '', 'http://www.orvwatch.com/pages/get_signs.html', '',
'64.34.145.201', 1185539899) in /home/hamburgi/public_html/orvwatch/includes/database.mysql.inc on line
121

I found it today in one of my sites. It occur when I try to open menu in Site Building and Site Configuration menus. Seems there are connection problem between my site (using drupal) and MySQL server. Someone in drupal forum guessing this maybe because two problems, which result in the same error:

1. Timeout (in my case): There I think it's a general problem of the drupal database connection handling. This error occurs as soon as a function runs longer than the db connection timeout setting (this may vary from host to host) without db interactions and the host turned of auto-reconnect. This can happen in every module. The solution could be a manual reconnect of the drupal db handler or where possible to set auto-reconnect in php.ini.

2. Large Queries: I'm not sure if this happens. But there may be too large queries by some drupal modules which exceed the query-size limit.

And I am guessing number one is exactly the same problem I had with my site.

Change the php.ini, said someone in Drupal Forum. But how to change it because we dont have any access to change php.ini. But not for me, the hosting administrator had give php.ini file in every sites he hosted. Edit my php.ini, add this line :

memory_limit = 16M
mysqli.reconnect = On

And it works. mysql.reconnect means drupal sites will attempt to reconnect to MySQL databases even it had long query. Someone in drupal forums give another solutions, edit MySQL configuration file , my.ini file and change the value of max_allowed_packet :

[mysqld]
max_allowed_packet=24M


Good luck


Reply

The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
7 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.