MySQL server has gone away query warning

Status
Not open for further replies.

tomsm

New Member
Messages
17
Reaction score
0
Points
0
Thanks to increasing the memory limit to 64M I can access my Drupal site. But when I want to administer my site, for example access the status report page or any other admin section I get the following error:

Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:442022:\"Lost connection to MySQL server during query\nquery: UPDATE cache_update SET data = 'a:43:{s:10:\\"admin_menu\\";a:10:{s:5:\\"title\\";s:19:\\"Administration menu\\";s:10:\\"short_name\\";s:10:\\"admin_menu\\";s:10:\\"dc:creator\\";s:3:\\"sun\\";s:11:\\"api_version\\";s:3:\\"6.x\\";s:17:\\"recommended_major\\";s:1:\\"1\\";s:16:\\"supported_majors\\";s:3:\\"1,3\\";s:13:\\"default_major\\";s:1:\\"1\\" in /home/tomsm/public_html/includes/database.mysql.inc on line 128

Maybe some other MySQL settings need to be optimized? What are the mysql settings for free hosting accounts, such as wait_timeout and max_allowed_packet?

What can I do to solve this problem?
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Probably just a temporary issue. I'd wait a few days and see if it stops. If not, post here again :)
 

tomsm

New Member
Messages
17
Reaction score
0
Points
0
I think the wait_timeout is set to 15s. For a Drupal site this setting may be too low. I have modified the database.mysql.inc file as described on www.drupal.org:

In includes/database.mysql.inc, at the end of function db_connect(), under the "SET NAMES" line:

mysql_query('SET SESSION wait_timeout = 60', $connection);


Now I can access all admin pages without this gone away error.

Also see: http://drupal.org/node/227445

Question: Can I adjust the max_allowed_packet and wait_timeout variable of my free hosting account as mentioned here: http://drupal.org/project/db_tweaks
 
Last edited:

adamparkzer

On Extended Leave
Messages
3,745
Reaction score
81
Points
0
I know of a website hosted on x10Hosting that has Drupal and is functioning fine. Are those modifications necessary and/or preventing you from using your site properly?
 
Status
Not open for further replies.
Top