This is very critical error found in MySQL. This error originate when you are dealt with huge records. There are various unanswered forum you will found when you Google that problem. The reason behind this crash is packet size. By default, MySQL configuration max_allowed_packet is set it to 16M. This settings may introduce this exception in your website..
Solution:
To resolve that problem you needs to increase max_allowed_packet variable in MySQL. Add following line in my.ini
Solution:
To resolve that problem you needs to increase max_allowed_packet variable in MySQL. Add following line in my.ini
max_allowed_packet=100M
Save the file and restart MySQL service. Now onward you will never get that kind exception in your open source / website.
Thank you very much!
ReplyDeleteconfirmed, thanks. default install does not put my.cnf on freegbsd port, was not sure if freebsd had my.cnf at /etc/my.cnf or /usr/local/etc/my.cnf so sym linked w
ReplyDeletethank you!
ReplyDeleteThanks very much man
ReplyDeletethank you very much!!!
ReplyDeleteI change from max_allowed_packet=128M
ReplyDeleteto max_allowed_packet=256M
nothing change. still
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Uncaught exception thrown in session handler.
PDOException: There is already an active transaction in _drupal_session_write() (line 206 of C:\user\....\acquia-drupal\includes\session.inc).
what can be the reson?
THANK YOU
You should restart mysql server. Using mysql slow query log find it out which query takes too much time.
DeleteThanks Madhav Vyas your tip was a big help.
DeleteThanks Madhav Vyas I was beginning to lose my hair on this one! thought I'd managed to corrupt data with a bad transaction. Thankfully not !
DeleteSaved me a lot of hassle. Thank you!
ReplyDeleteAnyone has a idea how to deal with the same error when its on sqlite n not mysql
ReplyDeleteHola, dónde puedo encontrar el archivo max allowed packet? gracias
ReplyDeletethanks saved me a lot of time
ReplyDeleteHow to do this on shared server and drupal
ReplyDeleteIn drupal , you needs to add following link in your .htaccess file available in site root.
Deletephp_value memory_limit 400M
max_allowed_packet=100M is excessif.. default is 1M so try with perhaps max_allowed_packet=12M first.
ReplyDeleteI found the same Error in Yii: Above solution "change in my.ini
ReplyDeletemax_allowed_packet=100M" didn't work.:(
i got the same error with drupal 7 and did all the above but still the same error comes again
ReplyDeletei also doubled other values for cache and mysqldump but also nothing changed
surely restarted mysql and restarted Ubuntu as well
please help
Madhav, thank you very much indeed!
ReplyDeletewhen i enabled rules ui, this appears the same problem SQLSTATE[HY000]: General error: 2006 MySQL server has gone away and i did it to increase the size, but itsnt working well i can´t get any content types and this appear the problem, help!
ReplyDeleteYou may also need to increase the maximum packet size on the client, It will helps to overcome your error.
DeleteThanks
DeleteThank you for sharing! Helped me to solve an issue just now!
ReplyDeletethere is no my.ini file. What can I do now?
ReplyDeleteCan you give some more details about your OS.
DeleteI am on Fedora running xampp
ReplyDeleteit's installed under lampp/htdocs/xampp
i can't find my.ini
whereis my.ini returned nothing.
Ideas?
Ok I found under /lampp/etc/my.cnf
ReplyDeletein there there is a
[mysqld]
max_allowed_packet = 1M
[mysqldump]
quick
max_allowed_packet = 16M
I changed the first 1M to 16M , restarted lampp , mysql, everything and now everything is fine. Thanks!
whoever you are, you are a life saver
ReplyDeletethanks Madhav Vyas!!!
ReplyDeletehere is my error in mysql:
ReplyDeletePDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {uc_product_classes}; Array ( ) in uc_product_class_load() (line 1515 of /www/vhtdocs/dev_twe_reseller/sites/all/modules/ubercart/uc_product/uc_product.module).
I have chenged max_allowed_packet in my.cnf file. that also not working.
am using linux os + drupal + mysql
PLZ HELP ME.
thumb up ... thx
ReplyDeleteAdditional uncaught exception thrown while handling exception.
ReplyDeleteOriginal
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT filename FROM {registry} WHERE name = :name AND type = :type; Array ( [:name] => views_plugin_display_default [:type] => interface ) in _registry_check_code() (line 3091 of /home/fada/public_html/mobaderoon/includes/bootstrap.inc).
Additional
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT ff.* FROM {filter_format} ff WHERE (status = :db_condition_placeholder_0) ORDER BY weight ASC; Array ( [:db_condition_placeholder_0] => 1 ) in filter_formats() (line 427 of /home/fada/public_html/mobaderoon/modules/filter/filter.module).
iam using shared hosting multisites .. one site is working and another not same core and different database
what should i do ?
Hi I'm using shared server... & CakePHP.... Can any body help me for this issue...
ReplyDeletei am suffering from same issue but only when i enter admin area please help me
ReplyDeleteCan you elaborate your question please? Which admin area are you talking about?
Deletethank you it 's working ! ! !
ReplyDeleteI am facing the same problem on my project running on bluehost servers. How can i chnage my.ini at server?
ReplyDeleteIf the solution should change the parameters, so the concluding we can not work with Drupal on a free web hosting service.
ReplyDeleteChanging my.cnf worked for me . Thanks !
ReplyDeleteYou're a life-saver. I was about to switch to Wordpress, but this gave me hope.
ReplyDelete