Hello

When editing any links menu in the demo store error:

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] => ru [: source] => Add a customer profile [ : context] =>) in locale () (line 684 of / var / www / vhosts / httpdocs / 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] => 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] = > ru [: source] = > Add a customer profile [: context] = >) [: Db_insert_placeholder_4] => 3 [: db_insert_placeholder_5] => [: db_insert_placeholder_6] => http://admin/structure/menu/item/778/edit [: db_insert_placeholder_7] => http:/// [ : db_insert_placeholder_8] => 46.229.191.142 [: db_insert_placeholder_9] => 1348557110) in dblog_watchdog () (line 154 of / var / www / vhosts / httpdocs / modules / dblog / dblog.module).

Setup mysql:
[Mysqld]
local-infile = 0
datadir = / var / lib / mysql
socket = / var / lib / mysql / mysql.sock
user = mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links = 0

[Mysqld_safe]
log-error = / var / log / mysqld.log
pid-file = / var / run / mysqld / mysqld.pid
innodb_rollback_on_timeout = 1
innodb_lock_wait_timeout = 600
max_connections = 350
log-bin = mysql-bin
binlog-format = 'ROW'
max_allowed_packet = 256M

OS Centos 6, Plesk Panel 11

Comments

theo_’s picture

Try to add following line under [Mysqld] section :
max_allowed_packet=100M

Nikulcov’s picture

Status: Active » Closed (fixed)

Here I am a fool)))
Not in that section added, thanks worked!

Thank you!

theo_’s picture

Status: Closed (fixed) » Fixed

Leave it as fixed since it can help other people ;)

Status: Fixed » Closed (fixed)

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

makokis’s picture

Try to add following line under [Mysqld] section :
max_allowed_packet=100M

in wich file have to add this? in what directory is this file?

Sorry i am newbie.

many thanks

MAMP Pro
MySQL 5.5.25
phpMyAdmin 5.4.4
PHP 5.4.4

makokis’s picture

Title: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL » SOLVED - PDOException: SQLSTATE[HY000]: General error: 2006 MySQL

To implement the fix on your install do the following to the file:

/Applications/MAMP/Library/bin/mysqld_safe

edit the file "mysqld_safe"

open it and add at the end of the line 735 (aprox 730-740)
for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
"--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" "--max_allowed_packet=268435456"
do

add at the end "--max_allowed_packet=268435456"

stop and restart mysql.

works for me !

makokis’s picture

thanks theo_, it works!

stuzog’s picture

Thanks! That worked in an OS X MAMP setup. Also added max_allowed_packet=128M to Resource Limits section of the php.ini(s) in MAMP.

jasonglisson’s picture

This was the only solution that worked for me. I tried everything else that I could find. Thank you for you're suggestion!

Horroshow’s picture

If you're using AMPPS none of the solution will work until you quit and restart AMPPS.

It's working for me now, thanks!

CD’s picture

Hi,

I have the latest version of MAMP Version 2.2 (2.2) running PHP 5.5.3.

I have the same problem after trying to add new product type in drupal 7 commerce:

Additional uncaught exception thrown while handling exception.

Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] => 0 ) in comment_count_unpublished() (line 314 of /Applications/MAMP/htdocs/new-site/modules/comment/comment.module).

I went to the "mysqld_safe" file and did what #6 suggests and it worked.

I love our community!!!

Thanks guys!!!