Closed (works as designed)
Project:
Drupal core
Version:
10.0.x-dev
Component:
database system
Priority:
Major
Category:
Support request
Assigned:
Reporter:
Created:
4 Jan 2011 at 07:57 UTC
Updated:
21 Sep 2022 at 19:20 UTC
Jump to comment: Most recent
Comments
Comment #1
keichee commentedPDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT b.* FROM {block} b WHERE (b.theme = :db_condition_placeholder_0) AND (b.status = :db_condition_placeholder_1) ORDER BY b.region ASC, b.weight ASC, b.module ASC; Array ( [:db_condition_placeholder_0] => bartik [:db_condition_placeholder_1] => 1 ) in _block_load_blocks() (line 708 of C:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\modules\block\block.module).
os: ubuntu and windows
Comment #2
keichee commentedLogo Here
Error
The website encountered an unexpected error. Please try again later.
Error messagePDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {cache_update} cache_update WHERE ( (cid = :db_condition_placeholder_0) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => update_project_data ) in _update_cache_set() (line 763 of C:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\modules\update\update.module).
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] => 11447990474d22d35a7f86c2.09295213 ) in lock_release_all() (line 247 of C:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\includes\lock.inc).
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:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\includes\session.inc).
Comment #3
keichee commentedLogo Here
Error
The website encountered an unexpected error. Please try again later.
Error messagePDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {cache_update} cache_update WHERE ( (cid = :db_condition_placeholder_0) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => update_project_data ) in _update_cache_set() (line 763 of C:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\modules\update\update.module).
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] => 18847400194d22d440b23367.75208826 ) in lock_release_all() (line 247 of C:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\includes\lock.inc).
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:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\includes\session.inc).
Comment #4
univate commentedThat error means you can't connect to mysql, see http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
Comment #5
keichee commentednope, i can go to the ?q=user and other parts but not the admin
Comment #6
keichee commentedLogo Here
Error
The website encountered an unexpected error. Please try again later.
Error messagePDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT b.* FROM {block} b WHERE (b.theme = :db_condition_placeholder_0) AND (b.status = :db_condition_placeholder_1) ORDER BY b.region ASC, b.weight ASC, b.module ASC; Array ( [:db_condition_placeholder_0] => bartik [:db_condition_placeholder_1] => 1 ) in _block_load_blocks() (line 708 of C:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\modules\block\block.module).
Uncaught exception thrown in session handler.
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: UPDATE {users} SET access=:db_update_placeholder_0 WHERE (uid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => 1294130151 [:db_condition_placeholder_0] => 1 ) in _drupal_session_write() (line 214 of C:\rnd\proprietary\rnd.emr.ph\drupal-7.x-dev\includes\session.inc).
Comment #7
damien tournoud commentedIt means that your MySQL server is configured with a ridiculously small timeout. See the page of the MySQL manual linked in #4 for solutions.
Comment #8
keichee commenteddrupal must auto connect to mysql server if that timeout happen, i guess drupal wont autoconnect on the fly
Comment #9
tim.plunkettComment #11
Crell commentedDrupal doesn't connect to MySQL until the first query is sent. A request almost never takes more than a second, and usually less than half a second. If your MySQL server is timing out in that amount of time it means MySQL is misconfigured.
Please verify that you have a reasonable wait_timeout. I suspect simply increasing that will solve the problem.
Comment #12
wouter99999 commentedI got similar errors with a new installation on 64bit Windows 7. This has to do with maximum allowed packet size in MySQL. To solve, add in the [mysqld] section in my.ini: max_allowed_packet=100M and restart MySQL
Comment #14
madhavvyas commentedComment #15
orendain commented+1 for the solution above.
Comment #16
keichee commentedmany thanks
Comment #17
keichee commentedComment #18
joe casey commented#12 above worked for me.
WAMP on Windows 7 localhost. Site ran fine but devel module dpm() call blew up with the 'MySQL server has gone away' message.
#12 solved it, #13 didn't help in my case.
Comment #19
Julia_yl commented#12 above worked for me too thanks lots
Comment #20
wildermuthn commented#12 worked for me. Also after reading http://www.midwesternmac.com/blogs/jeff-geerling/mysql-general-errors.
Comment #21
muschpusch commentedmaybe not related but the solution from #20 worked for me. I got sleeping mysql processes running forever (until max connections where reached). It was when visiting admin/config in D7.8
Comment #22
bassplaya commentedI've done the same thing as wouter99999 instructed in #12 (in a my.cnf file, copied from my-medium.cnf file) does but I extended it to 256M. I'm running MAMP Free and I must say that one site still gives me the error message when I'm trying to add a content type and the other doesn't. No idea why the other doesn't. If anyone knows, please share.
Comment #23
bassplaya commentedit really is the 256M that does the trick. If I set it to 100M it throws that nasty error.
Comment #24
majingas commented#12 worked for me aswell. Wamp on wun 7 64.
Comment #25
phprf commented#12 Worked great for me! Wamp on Win7 Pro 64bit. Many thanks and God bless!
Comment #26
freerider839 commented#12 and #13 worked for me. thanks
Comment #27
wwgrey commentedWAMP on Windows 7 localhost:
#12 removed the issue
Thanks !
Comment #28
shasha_s commentedhello,
on Acquia dev desktop, win7 I changed in my.cfn
max_allowed_packet=128M to 256M
but I still get this, when I want to add new content type.
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
and
Uncaught exception thrown in session handler.
PDOException: There is already an active transaction in _drupal_session_write() (line 206 of...
how can I solve it?
thank you.
S.
Comment #29
kappaluppa commentedPost #12 http://drupal.org/node/1014172#comment-4142046
says change my.ini
Look in mysql/bin. This worked for me so far...
Comment #30
Tamanda commentedI had a similar problem, turned out the comment (#12) by wouter99999 fixed it. Thanks wouter99999, you saved me from a world of pain!!
Comment #31
clashar commentedwouter99999, thank you! your solution from #12 helped me well.
Comment #32
latulipeblanche commentedWhen you're on Linux, don't look for my.ini but for my.cnf
sudo gvim /opt/lampp/etc/my.cnf
sudo /opt/lampp/lampp restart
ntx wouter99999 http://drupal.org/node/1014172#comment-4142046
Comment #33
mrgoodcheese commented#12 fixed my issue. Thank you.
Comment #34
garypigott39 commented#12 fixed my issue, but it had to be in the [mysqld] section (edited via WAMP "my.ini" option)
Cheers for the post.
Comment #35
krisrobinson commentedJust highlighting this (#34) , make sure it's in the [mysqld] section, by default there is the same setting in the [mysqldump] section, can be confusing for some.
Comment #36
ahenfo commentedI have tried all the solutions given above but I'm still getting the same error message(MESSAGE BELOW). I am running Zend Server CE with the my-huge.ini as the default my.ini. I need help because all my drupal projects are inaccessible.
Error
The website encountered an unexpected error. Please try again later.
Error messagePDOException: SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown table engine 'InnoDB': SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of C:\Zend\Apache2\htdocs\academy.org\includes\lock.inc).
Uncaught exception thrown in shutdown function.
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown table engine 'InnoDB': DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 68667015250329455dbcd27.47278376 ) in lock_release_all() (line 269 of C:\Zend\Apache2\htdocs\academy.org\includes\lock.inc).
Comment #37
rogical commentedmax_allowed_packet = 16M solved my problem
Comment #38
ahenfo commentedComment #39
Exlord commentedmax_allowed_packet=100Mfixed mine ... tanks ...Comment #40
fire-wolf commented#12 helped mee too. Thank you!
Comment #41
clutherNOTE: I found this to be a very time consuming and frustrating problem to solve. I leave this post as search bait to help others with a similar issue.
On my Drupal 7 site I was experiencing WSOD when attempting to add/edit a menu item (/structure/menu/item//edit), content type (admin/structure/types/manage/) or feature (admin/structure/features/create). All the tips provided at http://drupal.org/node/158043 on dealing with WSOD were of no help. I increased my PHP memory and added error reporting statements to index.php (see http://drupal.org/node/158043), but still there was the White Screen of Death and a total lack of insightful messages in any of the error log files (watchdog, php, apache, sql).
Further experimenting, I tried simplifying my environment. After I turned off DEVEL and I was presented with a Fatal error: Exception thrown without a stack frame in Unknown on line 0 error when visiting the page. Not a fix, but much better than a blank screen.
I then found a tip at http://www.drupal4hu.com/node/222 which suggested the issue might be one of the following:
I followed the writer's recommendation of wrapping my index.php within a try-catch block and saving the catch to an error log. My index.php file now looks like:
NOTE: Less the ending ?>.
I visited the page again and noticed that the following error was written to my drupal_error.log file.
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Which then led me to this page and to posts 12 & 13. If you follow post 13's link you will find the following:
I'm using MAMP on MacOS. So I modified the MySQL's my.cnf file and upped the max_allowed_packet default from 1M to 100M. Saved and rebooted MAMP. Problem solved. Yeah!
Comment #42
Raffy Martinez commentedUpdated to 7.16 and got the error. # 12 worked but instead of 100M i set it at max_allowed_packet = 10M.
Thanks.
Comment #43
ydahiAfter moving my site to a vps I started seeing this error. The error was volatile and I could not reproduce manually - it was very sporadic.
I attempted to fix it by increasing the max_packet_size, however this didn't work.
I noticed some references to the theme registry in the error. My site utilizes Zen.
I went into the appearance admin section and turned off "Rebuild theme registry on every page. " in the theme settings.
This fixed the solution for me.
Comment #44
mrudolph commentedAs with ydahi (#43), it was the Zen theme which caused the aforementioned error with SQL, this after I had updated to Zen 7.x-5.1. No more playing with Zen, I guess!
Comment #45
willisiw commentedPerfect! Fixed my error on WAMP. I thought it had to do with my install of Commerce as it happened right behind installing a Commerce Module.
Comment #46
shankarpmenon commented#12 is not working for me,
i am using wamp my sql 5.5
i have two web site working locally. one is working fine but the other is not working when i click add content type or edit a content type. but other wise the site is working perfectly.
Comment #47
ticocr commentedit seemed that drupal needed more packages when reading from databases since limit was set to 1M for some reason it was the default since there was not config file.
the site was still working, since for normal use it doesn't take that much from the database, but when logged into the administration panel it did take a lot data from mysql, over 1M as it was set..... It was working with all the modules that I already installed but not all configured and up and running, since some of them were in the off mode... I just Enabled some features of some modules on the modules panel and started giving me that error, nothing displayed other than showing that error where said: "SERVER HAS GONE AWAY"...
my first reaction was::: FUCK!! as usual.. then i started thinking.. and my first though was to remove some modules from the modules folder, but then I figured that some modules are needed by other modules.. so that would take forever, ... then I realized that it was showing a server issue... so i thought it was apache.. then mysql, and i started looking for mysql config file and no file found.,.. then I started reading about it mysql website and it popped up
so i knew it was mysql-server configuration, then I saw a post in drupal that said it was the packages drupal was getting from mysql... so what need to be modify was:
max_allowed_packet=1M to 2 or more Megs in mysql's my.cnf file.
Comment #48
bisonbleu commentedRan into the same problem. This post on StackOverflow fixed it for me.
My setup:
- MAMP 1.9.6.1 (PHP 5.3.5, mySQL 5.5.9)
- MAMP/conf/my.cnf
- Drupal 7.21
Comment #49
albertosouza commentedI'm using gnu/linux fedora and add the setting of max_allowed_packet like comment #12 in the file /etc/my.cnf did not work.
After some testing i could change the configuration max_allowed_packet using the /etc/my.cnf.d/server.cnf and now the error gone away from my pc
Comment #50
ashwinsh#12 is working for me.
Thanks.
Comment #51
afoster commented#12 worked for MAMP 2.1.1. on OSX 10.8
Comment #52
namjoo commentedhi
sorry for my english
i test it and solve my problem.
in mysql shell insert this command
mysql >> SET GLOBAL max_allowed_packet=32*1024*1024;
and then import database
my os is centos 5
Comment #53
zelot commentedthanks #12. Works just fine
Comment #54
famishedroad commented#12 worked perfectly for me! Many thanks.
Comment #55
NineAllexis commented#12 worked for me, too! Thanks alot!
Comment #56
maikelm commentedThanks, that's the general solution
Comment #57
cwpates commentedFor what It's worth, last step in installing Drupal Commons, this worked for me. Thanks..
Comment #58
alifspb commentedDefault Re: High load: mysql --log-error=/var/lib/mysql/...
Since you are using MySQL 5.0, please try the following values to replace your existing /etc/my.cnf file (which might not be accurate to use as MySQL had been restarted in less than 24 hours when mysqltuner.pl was run):
Code:
[mysqld]
innodb_buffer_pool_size=20M
key_buffer_size = 512M
max_allowed_packet=100M
max_connections=500
max_heap_table_size=24M
open_files_limit=5000
query_cache_size=8M
table_cache = 2200
thread_cache_size=4
tmp_table_size=40M
log-slow-queries=/var/lib/mysql/slow.log
After this, then create the slow query log using these commands:
Code:
cd /var/lib/mysql
touch slow.log
chmod 660 slow.log
chown mysql:mysql slow.log
After doing that, then restart MySQL:
Code:
/etc/init.d/mysql restart
this help me solve my problem thanks
Comment #59
sonekun commentedI was having a problem with this uncaught exception error and server has gone away message when I tried to edit an order in drupal commerce (on shared hosting). I went back to my local host and checked if it gave the same error. It gave a different error relating to drupal firebug module. I then turned off Drupal Firebug and Drupal for Firebug Preprocessor modules. The error went away. Hope this helps somebody.
Comment #60
lprancourt commented#12 Seems to solve this issue, but my website is hosted and I don't have access to that specific file. It is really bugging me as I can't use my admin user at all, I'm stuck. Everything was working well and have been for the last 3 months, on a production server, than I had many spams and tried to put in antispam module, and boom, now my admin user gets the WSOD , but not restricted users.
The site is still available for most, but my admin is dead, I really need to fix this, but I don't know how to change that setting in a shared server environment.
Thank for any help you can provide!
Comment #61
mariskath commentedI'm having a similar problem while trying to install Drupal 7.
After installing 27 modules (of 28) I get the following message:
'An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://localhost/drupal/install.php?profile=standard&locale=en&id=1&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => menu_rebuild ) in lock_may_be_available() (line 167 of C:\wamp\www\drupal\includes\lock.inc).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] => 802228002541876118e8773.14607894 ) in lock_release_all() (line 269 of C:\wamp\www\drupal\includes\lock.inc).Uncaught exception thrown in session handler.PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ); Array ( [:db_condition_placeholder_0] => ZLNqcOjZv5_OY8Y_fNwE0Il6hHmlJCLVL9qK5XUBTIo [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of C:\wamp\www\drupal\includes\session.inc).'
I have raised the number of the max_allowed_packet to various high amounts.
I have installed WAMP anew.
I have raised other numbers in my my.ini.
Each time I delete Drupal, my databank and my history in Chrome.
I have tried a lot of things, but I do not manage to install Drupal correctly. What can I try next?
Thanks,
Mariska.
Comment #62
ximix commented#12 worked for me, too!! Thanks alot!!
Comment #63
Eranga commented#12 worked for me.. Thanks
Comment #64
Tharick commented#12 works well :-)
Comment #65
smndey commented#12 Worked for me. Thanks
Comment #66
schellenbergk commented#12 did not work for me - and I'm still flailing about trying to install Drupal (been at this since March 17). If anyone can help I will really appreciate it. It seems Mariska #61 is having similar issues...
Here's what I've tried.
• Installed wampserver 64-bit on my Windows 7 64-bit machine following the instructions on the drupalize.me video
• Installed Drupal 7.35 per the instructions on the drupalize.me video but at Step 26 I get a “General error: 2006 MySQL server has gone away” error. WAMP goes from green to orange immediately at this step.
• Uninstalled wampserver 64-bit, reinstalled and (per #12) changed the MySQL “my.ini” file line “max_allowed_packet” from 1M to 100M. Reinstalled Drupal, but at Step 26 I get the same error.
• Uninstalled wampserver 64-bit, reinstalled and (per #12) changed the MySQL “my.ini” file line “max_allowed_packet” from 1M to 100M. Also (per another page at Drupal.org) changed [wampmysql] to [wampmysql64]. Reinstalled Drupal 7.35, but at Step 26 I get the same error.
• Uninstalled wampserver 64-bit, installed wampserver 32-bit and (per #12) changed the MySQL “my.ini” file line “max_allowed_packet” from 1M to 100M. Reinstalled Drupal 7.35, but at Step 26 I get the same error.
It’s obviously something wrong with MySQL – but what? I’ve search all over the internet, and the MaxPackets solution in #12 seems to fix it for most people but not for me?
Please can anyone help?
Comment #67
AlexFMartin commentedI was trying to install 7.36 locally and kept getting the a similar issue as Mariska #61 and schellenbergk #66. I configured my mysql settings to consume more resources and have a longer timeout and it did nothing! I couldn't figure out why it was still throwing the ajax error Mariska was getting. When I checked the mysql log file it kept saying that I didn't have permissions. I'm on win7 so...yes...I do have permission. Why had I been able to do this on my old computer all the time, and not this one? The only difference I could find was that McAfee came installed on this one (I had been using avast). When I disabled it I was able to install drupal on my localhost like normal! Very frustrating, so if that's the situation you find yourself in, give it a try. It might save you some time, if you can remember to turn your antivirus back on one you're installed :)
Comment #68
schellenbergk commentedSo after simply waiting a few weeks, I tried again and the issue has gone away. It seems the latest version has fixed whatever incompatibilities existed in the Windows configuration that I and a handful of other had.
Many thanks!!
Comment #69
MichaelJOC2 commentedI had this error and came up with my own fix.
I am using wampp on windows 7. The problem appeared on local host.
I tried changing the max allowed packet. No effect. I tried restarting mysql server from xampp. No effect.
Another symptom I had was that when I had the problem, on starting mysql server at first there was a message which seemed to say there was a port conflict, then mysql server said that it started successfully.
I checked for port conflicts between mysql server and some other running process but didn't find one.
Here is what worked for me.
I used netstat to get the PID of the running mysql process (or at least whatever process was using the same port as mysql).
I then went to task manager found that process and killed it.
In xampp I restarted mysql server.
Problem fixed. I don't really know why it worked. Best guess is that mysql had somehow started twice, or at least when it stopped it still kept some resources and/or did not stop and clear down completely.
Hope this might help someone.
Comment #70
mamourou commentedHello , I load my drupal website via Fillezilla and it has received . When finished, in my browser I grabbed www.monsite.com/install.php to finalize the publication and once the party of choice for database I are mistakes once I selects the base all data by inserting the name of the database and password . What should I do please ?
Comment #71
kenorb commentedI had to increase to:
max_allowed_packet = 200MSince my code was dumping very big Guzzle objects via watchdog.
Comment #72
janspeer commentedit has something todo with enabling multiple new modules in one go
and then there can be a fail
if on a shared server that works perfect for all other drupal sites with the same workload and max allowed settings and you are on a shared server
what can you do ,
Comment #73
Huelfe commentedI've tried everything and I didn't get work, but then I took a look into the mysql_error.log:
So I increased
innodb_log_file_sizefrom 5M to 256M in my.ini.My changes in my.ini are
innodb_log_file_size = 256MAnd under [mysqld] in my.ini:
max_allowed_packet = 100MNow everything is working fine.
Comment #74
cilefen commentedmax_allowed_packet is documented in the installation requirements.
Comment #75
MarcelMüller1978 commented#12 fixed my issue too
Comment #76
kavbiswa commented#12 worked for me too. Many thanks.
Comment #77
cilefen commentedI am setting the correct status because of #74.
Comment #78
cilefen commentedComment #79
idris_9791 commented#12 is not working for me.. I was changed the max execution limit but still occuring the same error. Below i have place the error details.
PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in lock_may_be_available() (line 167 of C:\xamppnew\htdocs\csb\src\includes\lock.inc).
Can anyone please suggest this?????
Thanks,
Idris
Comment #80
kenorb commented@idris_9791 Please follow: Solving “MySQL server has gone away”, mysql error 2006
Comment #81
jaiiali commented#12 worked for me too. Many thanks.
Comment #82
usama009 commentedThank you #12
Comment #83
hiramanpatilI have updated
max_allowed_packet = 200Mbut still not working for me.I am using Drupal 8 on Ubuntu 14.04.
Getting below error message randomly.
Sometimes it shows below error message as well.
Anybody has faced this issue with Drupal 8? Please help.
Thanks
Comment #84
tomhung commented#12 worked for me
Comment #85
rajeev_drupal commentedIncreasing the max_allowed_packed to 16 M worked for me.
Comment #86
LAguilar commented#12 worked for me
Comment #87
muranod commentedWell, that was several wasted days for a simple fix (#12 worked - had switched to XAMPP). Moral is, read ALL of the logs. THANK YOU!!
Comment #88
cilefen commentedIt is also published in https://www.drupal.org/docs/7/system-requirements/database-server
Comment #89
nellngun commentedAny solution for shared server?
Comment #90
hardik jayeshbhai hihoriya commented#12 Worked for me.
Thank you very much.
Comment #91
madhavvyas commentedRequired Mysql configuration to avoid such error
https://www.drupal.org/node/259580
Comment #92
mariami.ta commentedmax_allowed_packet = 100M only Worked for me on drupal 8.3.6
Comment #93
wolffereast commentedComment #94
pillona commentedI spent a long time finding a solution for this, so here's my two cents.
I had the same problem when updating an old drupal 6 website to drupal 7.
In my case I could not set max_allowed_packet to more than 32M, and with 32M I still had the error.
But actually I took a look at the session database and noticed that the table was more than 200M in a 300M database.
It seems like if all users sessions ever were still stored on the database without cleaning.
Actually, you can empty this table safely (it only has the side effect of disconnecting all active users, which in my case, as I am migrating the website to a new version, I do not care about...)
After fixing this, I could load the update.php, but ran into a similar problem this time mentioning the searchindex table, which again I cleared...
Comment #95
benjamin_dk commentedI have run into this issue as well, but raising the max_allowed_packet value to even 1024 does not help.
I don't know what caused the error to get triggered all of a sudden. I restarted the server recently after some standard apt upgrades. There are several other sites running with a similar setup, and the problem does not happen there.
I tried several things...
max_allowed_packetin/etc/mysql/my.cnfto 1024Mwait_timeoutin/etc/mysql/my.cnfto 600open_files_limitusing this methodHope someone has an idea how to troubleshoot from here!
Specs
Ubuntu 16.04, PHP 7.1.26-1
mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64)
I have used the Drupal-VM for setting up the server, with a NGINX and Node.js service running on a VPS with 8G RAM.
Configuration
my.cnf
Variables:
Update:
I never managed to fix this error by manipulating MySQL or OS settings. After consulting with others our diagnosis pointed to corrupted tables in the database.
We could not even run simple mysql count statements against certain tables without crashing the mysql process and in the mysql.err log we had ugly errors like these:
Luckily the tables didn't contain vital data, so I ended up truncating the tables.
I experienced this error across different servers around the same time which makes me suspect that a hardware / storage issue might be in play.
Comment #96
kenorb commentedComment #97
serialmother commented#12 works - Drupal 8 php 7.2.14
Thanks
Comment #98
kate_raquel commented+1 #12
it worked for me
Comment #99
munyiva#12 above worked for me in Mac
Comment #100
atsakoumis commentedI faced this problem in Drupal 7.72 when i try to open the new content type admin page. I changed the value of the variable "Maximum packet size" in the mySQL Server settings from 1MB to 2MB and it worked! Server System: CentOS Linux.
Comment #101
vindesh commentedSet Variable "max_allowed_packet=512M" to resolved my issue:
mysql Ver 14.14 Distrib 5.7.28, for macos10.14 (x86_64) using EditLine wrapper
macOS Catalina
Version: 10.15.3
https://www.drupal.org/project/drupal/issues/984112#comment-13795388
Comment #102
islamrobi commented#12 worked for me, thank you so much dear.
Comment #103
cristian100#12 did the trick, thanks.
Comment #104
balwant20 commentedI am also getting the same error. #12 resolved my error.
Comment #105
thallesIf you use lando:
.lando.yml