Hi I am new to drupal and with in a month period we went from D6 to D7 and I am trying all of them. On D7 beta3, the whole installation went well. While I tried to create a content type, I noticed that my auto_nodetile (alpha one) was not enabled. When I tried to enable it I got the message below and I can not access my modules any more. can someone help? Thank you.

Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {menu_router} WHERE path IN (:ancestors_0, :ancestors_1, :ancestors_2, :ancestors_3, :ancestors_4, :ancestors_5, :ancestors_6, :ancestors_7, :ancestors_8, :ancestors_9, :ancestors_10) ORDER BY fit DESC LIMIT 0, 1; Array ( [:ancestors_0] => admin/config/user-interface/uniform [:ancestors_1] => admin/config/user-interface/% [:ancestors_2] => admin/config/%/uniform [:ancestors_3] => admin/%/user-interface/uniform [:ancestors_4] => admin/config/user-interface [:ancestors_5] => admin/config/% [:ancestors_6] => admin/%/user-interface [:ancestors_7] => admin/%/% [:ancestors_8] => admin/config [:ancestors_9] => admin/% [:ancestors_10] => admin ) in menu_get_item() (line 426 of C:\xampp\htdocs\logm\includes\menu.inc).

Additional
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:802:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {menu_router} WHERE path IN (:ancestors_0, :ancestors_1, :ancestors_2, :ancestors_3, :ancestors_4, :ancestors_5, :ancestors_6, :ancestors_7, :ancestors_8, :ancestors_9, :ancestors_10) ORDER BY fit DESC LIMIT 0, 1; Array ( [:ancestors_0] => admin/config/user-interface/uniform [:ancestors_1] => admin/config/user-interface/% [:ancestors_2] => admin/config/%/uniform [:ancestors_3] => admin/%/user-interface/uniform [:ancestors_4] => admin/config/user-interface [:ancestors_5] => admin/config/% [:ancestors_6] => admin/%/user-interface [:ancestors_7] => admin/%/% [:ancestors_8] => admin/config [:ancestors_9] => admin/% [:ancestors_10] => admin ) ";s:9:"%function";s:15:"menu_get_item()";s:5:"%file";s:38:"C:\xampp\htdocs\logm\includes\menu.inc";s:5:"%line";i:426;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://localhost/logm/admin/modules [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1290443638 ) in dblog_watchdog() (line 155 of C:\xampp\htdocs\logm\modules\dblog\dblog.module).

--------------------------------------------------------------------------------

Uncaught exception thrown in session handler.
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in _drupal_session_write() (line 204 of C:\xampp\htdocs\logm\includes\session.inc).

Comments

Category:bug» support

It's not Drupal 7 problem.

MySQL server has gone away
You have to find it in http://dev.mysql.com/doc/refman/5.1/en/gone-away.html

Status:Active» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Hi Int, thank you for your reply! I will check it.
Terufat

How to fix this problem

  • Go to xampp\mysql\bin
  • Open my.ini
  • Change "max_allowed_packet" from "1m" to "16m"
  • Save my.ini
  • Now restart MySql through the XAMPP control panel.

Found this solution here. http://minorpoint.blogspot.com/2007/09/mysql-server-has-gone-away.html

Issue tags:+MAMP MySQL

Hey ^^

I got the same issue with MAMP. Since MAMP 1.9.6, the my.cnf is not included. But you still can create your own my.cnf !

1 - Create a "my.cnf" file in "/Applications/MAMP/conf/", or copy one of the "*.cnf" files from "/Applications/MAMP/Library/support-files/" to "/Applications/MAMP/conf/" and rename it to "my.cnf".
2 - Add/Modify your settings in the "my.cnf" file.
3 - Save the "my.cnf" file.
4 - Restart the servers.

Tips : You don't need to add all the parameters in the "my.cnf" file. It can just be :

[mysqld]
max_allowed_packet = 32M

When I installed Open Public distribution (runs on Drupal 7) on local MAMP server and I clicked on Modules page then MySQL gave error "PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away". Yes, this was a mysql configuration problem and not a Drupal bug. Change max_allowed_packet = 32M and adding this in a my.cnf file as suggested by #6 above worked for me. Thanks for your posts :-)

Thanks for that last tip GusGuss! Creating the my.cnf file and only having the max_allowed_packet defined did the trick for me.

Excellent ! Fixed the problem in a jiffy...

I just want to bump this solution because there are a lot of other solutions on the googles that tell you to put the my.cnf file in other locations that didn't work for me. "/Applications/MAMP/conf/my.cnf" worked for me in 2.0. Thanks GuGuss!

I'll second bander2's comment.

I searched for a solution for this for a few hours before finally stumbling across the instruction to put the my.cnf file in the "/Applications/MAMP/conf/" directory. (I had tried putting it in many other suggested directories..)

After that, my site was back up and running smoothly.

Thanks GuGuss for the suggestion!

Thanks for that last tip GusGuss! Had the same issue and I solved it with your suggestion.

If anyone is using MAMP 2.0.x, the solution above will not work. One needs to edit the my.cnf & php.ini only via MAMP.

Stop your server, edit the templates in Mamp at Menu: File/Edit Templates/ save and restart the server.

Thanks. This fixed it for me!

Thanks animelion. Post #5 worked for me.

I thank!

Assigned:Unassigned» Nyunt Win Aung
Status:Closed (fixed)» Active

Thanks, #5 works for me.

@animelion Thanks, yours tips work for me. :D

Assigned:Nyunt Win Aung» Unassigned
Status:Active» Closed (fixed)

Thanks sam6, editing template file in MAMP 2.0.x worked!!

#6 also fixed this for me.

Thank you very much @GuGuss

#6 worked for me as well. You guys are awesome. Thanks (:

Hi folks, I run into a similiar error with "MySQL server has gone away".

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT menu_links.* FROM {menu_links} menu_links WHERE (module = :db_condition_placeholder_0) AND (router_path = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => system [:db_condition_placeholder_1] => admin/config/content ) in admin_landing_page_access() (line 164 of C:\wamp\www\sites\all\modules\admin\admin.module).

Can anyone tell me what that means and how to fix this? I'm using WAMP and I already change the max_allowed_packet from 16M to 32M.

Thank you all in advance!

Did you restart MySQL after making the change?

If not you may want to restart it from the command line or simply restart the application/your computer.

Hi JoshuaPowell, thank you for the message. Yes, I restarted WAMP but it seems that it's not working after I made that change.

#6 did the trick.

Thanks GuGuss.

This is all fine for local dev but I need to set this on a remote server (Hostgator). Any clues?

Version:7.0-beta3» 7.14
Category:support» bug
Status:Closed (fixed)» Active

In my case the error message left me absolutely in the dark. Then I remembered that I had installed new modules and that I might have forgotten to run the update database. Running update database finally solved the problem.

Category:bug» support
Status:Active» Closed (fixed)

Thanks GuGuss, worked like a charm!! :)

Thanks #5 animelion - worked nicely!

For Linux / XAMPP, based on #5
I did :

  • in terminal $ locate my.cnf
  • in terminal $ sudo gvim /opt/lampp/etc/my.cnf
  • Changed "max_allowed_packet" from "1m" to "16m"
  • saved my.cnf
  • Restart XAMPP with $ sudo /opt/lampp/lampp restart

Paul

Version:7.14» 7.18

I have the same problem today in MAMP.
#6 works for me.
Thanks.

Thanks! Solution #5 worked like a charm! :D

Try #13 if you're using MAMP 2.x.x. Fixed the problem for me. Thanks!

#13 worked for me. Thanks!

Uncaught exception thrown in shutdown function.

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] => 169152141451dff8d4b69f78.07262902 ) in lock_release_all() (line 269 of C:\xampp\htdocs\glossy\includes\lock.inc).

Not Work for Me. I have try to set 32M in my.ini but not solve isssue.

You might find some hints at http://stackoverflow.com/questions/5058845/how-do-i-increase-the-stack-s...

Just another default setting which seems to differ between platforms.

hth
Frank

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => it [:source] => Administration [:context] => ) in locale() (line 720 of /Applications/MAMP/htdocs/FirstEclipse/drupal-7.23/modules/locale/locale.module).

Additional

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:382:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => it [:source] => Administration [:context] => ) ";s:9:"%function";s:8:"locale()";s:5:"%file";s:79:"/Applications/MAMP/htdocs/FirstEclipse/drupal-7.23/modules/locale/locale.module";s:5:"%line";i:720;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://localhost:8888/FirstEclipse/drupal-7.23/ [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1377907559 ) in dblog_watchdog() (line 160 of /Applications/MAMP/htdocs/FirstEclipse/drupal-7.23/modules/dblog/dblog.module).

i tryied #6
i dont have the edit/template in my mamp
and i also tryied #38 where i noticed it says Windows... but i cant understand what to change http://stackoverflow.com/questions/5058845/how-do-i-increase-the-stack-s...

I dont know how to make it work, please some help!
Thanks for all the support i had before to Register Here.

#5 worked for me. Thks

#6 solution works (Ampps/conf/my.ini) if you use the AMPPS stack http://www.ampps.com

I'm using MAMP Version 2.1.1
Solution #6 works

I copy /Applications/MAMP/Library/support-files/my-small.cnf file to /Applications/MAMP/conf/my.cnf
and change

[mysqld]
max_allowed_packet = 1M

to

[mysqld]
max_allowed_packet = 32M

Component:mysql database» ajax system

How can I do this if I'm on cloud hosting with cPanel?