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.
on a brand new kickstarter v2 installation, when going to Content>Settings-Content Types>Add content type
I get this error
Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {commerce_flat_rate_service}; Array ( ) in commerce_flat_rate_commerce_shipping_service_info() (line 120 of /******************************/sites/all/modules/commerce_flat_rate/commerce_flat_rate.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:119:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {commerce_flat_rate_service}; Array ( ) ";s:9:"%function";s:51:"commerce_flat_rate_commerce_shipping_service_info()";s:5:"%file";s:106:"/******************************/sites/all/modules/commerce_flat_rate/commerce_flat_rate.module";s:5:"%line";i:120;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://*************/admin/commerce/config/types/content/add [:db_insert_placeholder_7] => http://*************/ [:db_insert_placeholder_8] => 138.210.92.46 [:db_insert_placeholder_9] => 1347907872 ) in dblog_watchdog() (line 154 of /******************************/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 209 of /******************************/includes/session.inc).
Comment | File | Size | Author |
---|---|---|---|
#5 | product-display.png | 229.38 KB | nenaD-3 |
Comments
Comment #1
spanac CreditAttribution: spanac commentedYou have a problem with your local MySQL configuration.
To resolve that problem you need to increase max_allowed_packet variable in MySQL. Add following line in my.ini
max_allowed_packet=100M
Reference:
MySQL server has gone away
Tips and Tricks: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Comment #2
bojanz CreditAttribution: bojanz commentedThanks, spanac.
Comment #3
d0a0b CreditAttribution: d0a0b commentedThat was it, thanks!
Comment #4
steve65140 CreditAttribution: steve65140 commentedMany thanks spanac.
For Mac OS X users the file name is my.cnf
For users of MAMP PRO edit the my.cnf template file as MAMP PRO recreates the my.cnf file every time it starts.
Comment #5
nenaD-3 CreditAttribution: nenaD-3 commentedFor Mac OS X users using PHP, MySQL on top of Apache, not MAMP, which is the file to alter and where it resides, please?
@bojanz My commerce kickstart2 installation attempts were initially failing during demo shop importing of content, due to memory-limit problem. I managed to localize invisible folder and fix this, following troubleshooting page instructions, increasing the limit at usr/local/php5/lib/ php.ini-recommended file, duplicating and renaming it to php.ini .
How do I fix this product-display issue in above described development configuration, please?
Comment #7
bojanz CreditAttribution: bojanz commentedWe should document this.
There's more usable info (instructions) in here: http://drupal.org/node/1794050
Comment #8
jebernier CreditAttribution: jebernier commented"For users of MAMP PRO edit the my.cnf template file"
any idea where this file is? I can't seem to find it.
Thanks-in-Advance,
John
Comment #9
odyseg CreditAttribution: odyseg commentedjust as I thought.. thanks!
Comment #10
klausiWe already have that doc page: http://drupal.org/node/259580
Please add any MAMP specific stuff there.
Comment #12
kbrinnerFor MAMP Pro users, stop your server, then go to File -> Edit Template -> my.cnf, and edit
max_allowed_packet = 100M
Save (command S) and then start your server again.
Comment #13
valeriap CreditAttribution: valeriap commentedThanks a lot. I see this is an old post, but I want to thank you anyway because I was getting crazy.
I was going to blame the Drupal requirements documentation, but Indeed the recommendation is also in the Drupal database requirements page: http://drupal.org/requirements/database.
Thanks!
Comment #14
tasetta CreditAttribution: tasetta commentedHi, using MAMP here, stuck with MySQL server has gone away error, and I cannot figure out where to find my.cnf.
File -> Edit Template -> is where? should I find it inside the ecommerce kickstart installation files or within the MAMP files?
Comment #15
tasetta CreditAttribution: tasetta commentedHi, using MAMP here, stuck with MySQL server has gone away error, and I cannot figure out where to find my.cnf.
File -> Edit Template -> is where? should I find it inside the ecommerce kickstart installation files or within the MAMP files?
Comment #16
DamienMcKenna@tasetta: Don't be afraid to use Google for these generic MySQL questions ;-) This page on StackOverflow has some good info on the steps you need to take to set up a my.cnf file on the non-Pro version of MAMP: http://stackoverflow.com/questions/678645/does-mysql-included-with-mamp-...
Comment #17
knalstaaf CreditAttribution: knalstaaf commented@tasseta:
MAMP/Library/support-files
) and save it toMAMP/conf/my.cnf
max_allowed_packet = 100M
(around line 30 of that file this should already be provided, be it with a lower value)Source 1
Source 2
Comment #18
dpimatrix CreditAttribution: dpimatrix commentedI had to increase mine to 200M for it to work.
Comment #19
fyberoptik CreditAttribution: fyberoptik commentedBig thanks! @knalstaaf
#17 works for me!
Comment #20
nikitas CreditAttribution: nikitas commentedthanx! #17 works for me too.
Mac OS Yosemite 10.10.3 (14D131) with MAMP 3.0
my.cnf was the solution to my problems :)
Comment #21
Dusza CreditAttribution: Dusza as a volunteer commentedupdating the mysql settings worked like a charm. don't forget to stop/start services and if you have InnoDB there is 1 extra step.
source: https://silicondales.com/tutorials/aws-ec2-tutorials/setup-mysqls-cnf-mi...
Comment #22
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 #23
spanish-reina CreditAttribution: spanish-reina commentedThank you Spanac! That worked just fine.