Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#87 | Screenshot at Aug 20 19-59-17.png | 238.6 KB | vindesh |
Comments
Comment #1
int CreditAttribution: int commentedIt'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
Comment #2
int CreditAttribution: int commentedComment #4
tdeneke CreditAttribution: tdeneke commentedHi Int, thank you for your reply! I will check it.
Terufat
Comment #5
bryancasler CreditAttribution: bryancasler commentedHow to fix this problem
Found this solution here. http://minorpoint.blogspot.com/2007/09/mysql-server-has-gone-away.html
Comment #6
GuGuss CreditAttribution: GuGuss commentedHey ^^
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 :
Comment #7
anthonyalbertyn CreditAttribution: anthonyalbertyn commentedWhen 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 :-)
Comment #8
johnnydarkko CreditAttribution: johnnydarkko commentedThanks for that last tip GusGuss! Creating the my.cnf file and only having the max_allowed_packet defined did the trick for me.
Comment #9
creact CreditAttribution: creact commentedExcellent ! Fixed the problem in a jiffy...
Comment #10
bander2 CreditAttribution: bander2 commentedI 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!
Comment #11
dshields CreditAttribution: dshields commentedI'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!
Comment #12
fairsayan CreditAttribution: fairsayan commentedThanks for that last tip GusGuss! Had the same issue and I solved it with your suggestion.
Comment #13
sam6 CreditAttribution: sam6 commentedIf 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.
Comment #14
aaronjay CreditAttribution: aaronjay commentedThanks. This fixed it for me!
Comment #15
payamspot CreditAttribution: payamspot commentedThanks animelion. Post #5 worked for me.
Comment #16
phthao CreditAttribution: phthao commentedI thank!
Comment #17
Nyunt Win Aung CreditAttribution: Nyunt Win Aung commentedThanks, #5 works for me.
Comment #18
inotafila CreditAttribution: inotafila commented@animelion Thanks, yours tips work for me. :D
Comment #19
Letharion CreditAttribution: Letharion commentedComment #20
ahimsauziThanks sam6, editing template file in MAMP 2.0.x worked!!
Comment #21
pipep CreditAttribution: pipep commented#6 also fixed this for me.
Thank you very much @GuGuss
Comment #22
kholloway CreditAttribution: kholloway commented#6 worked for me as well. You guys are awesome. Thanks (:
Comment #23
DrupalDan CreditAttribution: DrupalDan commentedHi 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!
Comment #24
DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz CreditAttribution: DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz commentedDid 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.
Comment #25
DrupalDan CreditAttribution: DrupalDan commentedHi JoshuaPowell, thank you for the message. Yes, I restarted WAMP but it seems that it's not working after I made that change.
Comment #26
JamesPosko CreditAttribution: JamesPosko commented#6 did the trick.
Thanks GuGuss.
Comment #27
Anonymous (not verified) CreditAttribution: Anonymous commentedThis is all fine for local dev but I need to set this on a remote server (Hostgator). Any clues?
Comment #28
wbartussek CreditAttribution: wbartussek commentedIn 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.
Comment #29
marcingy CreditAttribution: marcingy commentedComment #30
nexus666 CreditAttribution: nexus666 commentedThanks GuGuss, worked like a charm!! :)
Comment #31
DeNelo CreditAttribution: DeNelo commentedThanks #5 animelion - worked nicely!
Comment #32
latulipeblanche CreditAttribution: latulipeblanche commentedFor Linux / XAMPP, based on #5
I did :
Paul
Comment #33
sakilcse CreditAttribution: sakilcse commentedI have the same problem today in MAMP.
#6 works for me.
Thanks.
Comment #34
lachokun CreditAttribution: lachokun commentedThanks! Solution #5 worked like a charm! :D
Comment #35
predde CreditAttribution: predde commentedTry #13 if you're using MAMP 2.x.x. Fixed the problem for me. Thanks!
Comment #36
houstonaplus CreditAttribution: houstonaplus commented#13 worked for me. Thanks!
Comment #37
mayur.pimple CreditAttribution: mayur.pimple commentedUncaught 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.
Comment #38
Frank Ralf CreditAttribution: Frank Ralf commentedYou 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
Comment #39
wyahl CreditAttribution: wyahl commentedPDOException: 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.
Comment #40
augustomini CreditAttribution: augustomini commented#5 worked for me. Thks
Comment #41
rickhocutt CreditAttribution: rickhocutt commented#6 solution works (Ampps/conf/my.ini) if you use the AMPPS stack http://www.ampps.com
Comment #42
robertoperuzzoI'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
Comment #43
kopeboy CreditAttribution: kopeboy commentedHow can I do this if I'm on cloud hosting with cPanel?
Comment #44
ja09 CreditAttribution: ja09 commented#6 worked for me in MAMP 2.1.3, but only with the following 2 lines in my.cnf:
Also had to quit and relaunch MAMP for it to work. Stopping & starting the servers didn't work for me, tried quitting and it works great.
Thanks much!
Comment #45
brad.curnow CreditAttribution: brad.curnow commentedThanks animelion, #5 worked for me.
Comment #46
udaykant CreditAttribution: udaykant commentedThank you! so much. This has been solved my problem. Amazing!
Comment #47
udaykant CreditAttribution: udaykant commentedThank you! so much. This has been solved my problem. Amazing! (:D)
Comment #48
irinaz CreditAttribution: irinaz commentedThank you, this is great!
Comment #49
augbog CreditAttribution: augbog commentedRunning MAMP 3.0.5 and Drupal-7.28 and got this error. This worked for me. Thanks a lot @GuGuss
As mentioned, make sure you restart your MAMP server!
Comment #50
davidkp CreditAttribution: davidkp commentedPDO Exception Fixed
I was was getting this PDO Exception error when I was trying to add or edit a new content type.
I suspected the Token module was causing the problem as adding a new content type had been getting slower and slower. So after some searching I found some posts that confirmed using tokens creates a large overhead. This lead to me installing the Token Tweaks module which I configured to level 2 and this fixed my problem!
Comment #51
333martine CreditAttribution: 333martine commented#5 worked for me. Thanks.
Comment #52
Larzan CreditAttribution: Larzan commentedAMPPS 2.1:
#5 fixed it for me:
In the AMPPS control panel go to MySQL->Configuration, search for
max_allowed_packet
and change its value to at least 16MComment #53
gumdal CreditAttribution: gumdal commentedI am using XAMPP, it is fixed for me too, but my my.cnf file was in different location:
XAMPP/xamppfiles/etc/my.cnf
Comment #54
kvu@csusm.edu CreditAttribution: kvu@csusm.edu as a volunteer and commentedWAMP 2.5, 64-bit version needs 1 extra step
If you are using WAMP 2.5, 64-bit version, you will notice a bug in which your changes in
my.ini
does not take effect. Inside my.ini, you need to change[wampmysqld]
to[wampmysqld64]
. Then, changing themax_allowed_packet
should work, as it did for me.Comment #55
portulacaThank you for the suggestions, it worked for me on CentOS too: changed max_allowed_packet to 32M
nano /etc/my.cnf
max_allowed_packet = 32M
service mysqld restart
Comment #56
Dusza CreditAttribution: Dusza as a volunteer commentedif you have InnoDB look at this:
https://silicondales.com/tutorials/aws-ec2-tutorials/setup-mysqls-cnf-mi...
Comment #57
merkdit-mork CreditAttribution: merkdit-mork commented#5 fixed it for me. Many thanks!
Comment #58
mamourou CreditAttribution: 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 #59
ajaybhaskarHi,
I have follow the below guide line and resolved my problem.
Thanks
Comment #60
ZyverVenz CreditAttribution: ZyverVenz commentedHi,
Solved my problem
"max_allowed_packet" from "1m" to "250m"
Thanks guys
Comment #61
Huelfe CreditAttribution: 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_size
from 5M to 256M in my.ini.My changes in my.ini are
innodb_log_file_size = 256M
And under [mysqld] in my.ini:
max_allowed_packet = 100M
Now everything is working fine.
Comment #62
cilefen CreditAttribution: cilefen commentedmax_allowed_packet is documented in the installation requirements.
Comment #63
kenorb CreditAttribution: kenorb commentedRelated at SE (for possible solutions):
- General error: 2006 MySQL server has gone away
- MySQL error 2006: mysql server has gone away
- ERROR 2006 (HY000): MySQL server has gone away
- MySQL Server has Gone Away in Drupal 7
Comment #64
nareshbw CreditAttribution: nareshbw as a volunteer commentedThanks comment# 5 helped me to resolve this issue .
Comment #65
scripter81 CreditAttribution: scripter81 commentedThanks a lot to #5 it solved my issue.
Comment #66
dadderley CreditAttribution: dadderley as a volunteer commentedThank you GusGuss for the tip in comment #6 above
I moved a Drupal (7.50) site from the production server to my local MAMP environment.
All was good until I went to start editing the menus.
Big MySQL errors.
Your configuration
in a newly created file called 'my.cnf' and placed here:
/Applications/MAMP/conf/my.cnf
solved the problem.
Comment #67
amaperfect.com CreditAttribution: amaperfect.com as a volunteer and commentedI follow "bryancasler" instruction, it work thanks
Comment #68
hhetpanchal CreditAttribution: hhetpanchal commentedI haven't done anything I just restarted my apache and mysql and it's working perfectly fine.
Comment #69
akozoriz CreditAttribution: akozoriz commented#6 solved problem for XAMPP
Comment #70
amaperfect.com CreditAttribution: amaperfect.com as a volunteer and commentedThanks animelion, post #5 worked for drupal 7.
Comment #71
gambithi CreditAttribution: gambithi commentedI have MariaDb and the problem was solved with the command into that :
SET GLOBAL max_allowed_packet = 1024 * 1024 * 512;
Comment #72
zakalkar CreditAttribution: zakalkar commentedThanks a lot, it works...
Comment #73
Girum CreditAttribution: Girum commented-> Xamp->Mysql->Bin/my.ini
change
max_allowed_packet = 1M
to
max_allowed_packet = 16M
save!
done reload
xamp
# The MySQL server
[mysqld]
basedir = "C:/xampp/mysql/"
datadir = "C:/xampp/mysql/data/"
port = 3306
socket = "MySQL"
skip-locking
key_buffer = 16M
max_allowed_packet = 16M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
Comment #74
garryh CreditAttribution: garryh as a volunteer commentedJust saw this error for the first time. Huge thanks to #6 & #7 for helping me solve this quickly.
Comment #75
calefilm CreditAttribution: calefilm commentedUsing MAMP Version 3.5
#6 did the trick for me too. Thanks GuGuss!
Comment #76
zeev CreditAttribution: zeev as a volunteer commented#6 worked
Comment #77
imkartik CreditAttribution: imkartik at TATA Consultancy Services for Pfizer, Inc. commented+1 to #5
Comment #78
arv.drupal CreditAttribution: arv.drupal commented#5 worked for me. Thanks
Comment #79
pillona CreditAttribution: pillona as a volunteer commentedWhen you cannot increase the max_allowed_packet (due to constraints from your hosting company for example), and if the problem is with a table which is big (check in phpMyAdmin), you may meet success by reducing the table size.
- usually it will happen it a table that you can clear entirely (sessions, watchdogs, searchindex) before performing the query (like a big update...)
- or you can clean this table, for example deleting old revisions from node_revision table
See https://www.drupal.org/project/drupal/issues/1014172#comment-12794739
Comment #80
Chamikara.k CreditAttribution: Chamikara.k commented#6 worked !
Comment #81
Partha Sarathi CreditAttribution: Partha Sarathi as a volunteer commentedThanks @bryancasler
it worked for me.
Comment #82
pachabhaiya CreditAttribution: pachabhaiya as a volunteer and at Drupal Nepal commented+1 to #5 and #6.
Comment #83
kareemzok CreditAttribution: kareemzok as a volunteer commented#6, #5 worked.
Thanks !!
Comment #84
markpape CreditAttribution: markpape commented#6 worked on Drupal 7.63
Comment #85
destash CreditAttribution: destash commented#6, #5 worked.
Thanks all i
Comment #86
kumar.work007 CreditAttribution: kumar.work007 as a volunteer and commented@bryancasler #5
Thanks it worked for me
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.
Comment #87
vindesh CreditAttribution: vindesh as a volunteer and commented[Thu Aug 20 19:43:07.223888 2020] [php7:notice] [pid 1494] [client 127.0.0.1:52330] Drupal\\Core\\Database\\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {cache_bootstrap} (cid, expire, created, tags, checksum, data, serialized) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3......
I had the similar problem and increasing the max_allowed_packet to 128M/512M in mysqld section of my.cnf conf file has solved the error
Set in my.cnf configuration file
In /etc/my.cnf, change variables like:
$ sudo nano /etc/my.cnf
-----------------------------
[mysqld]
max_allowed_packet=512M
-----------------------------
If you do not find my.cnf file on your machine than you can create my.cnf conf file and write above code.
mysql Ver 14.14 Distrib 5.7.28, for macos10.14 (x86_64) using EditLine wrapper
macOS Catalina
Version: 10.15.3
OR
From command line login to mysql
$ mysql -u root -p
Enter password:
mysql> SET GLOBAL max_allowed_packet = 1024 * 1024 * 512;
its done.
Restart MYSQL: service mysqld restart
It is working for me.
Check the updated variable value on your phpmyadmin variable list.
Comment #88
cilefen CreditAttribution: cilefen commentedComment #89
thomaswalther CreditAttribution: thomaswalther commentedSET GLOBAL max_allowed_packet = 1024 * 1024 * 512; and restart help, yes.
But:
A restart helps for a certain time. After a while, the error occurs again. Only restarting helps again. But the cause was not solved, right?
Comment #90
nicklundy CreditAttribution: nicklundy at Millennium Communications commentedJust in case anyone else finds this issue, apparently you can receive this error also when trying to connect to MySQL on the wrong port number.
"PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away"