DOException: SQLSTATE[HY000]: General error: 2006 MySQL Additional uncaught exception thrown while handling exception.
original
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] => sv [:source] => No tokens available. [:context] => ) in locale() (line 676 of /home/.../modules/locale/locale.module).
additional
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] => sv [:source] => %type: !message in %function (line %line of %file). [:context] => ) in locale() (line 676 of /home/.../modules/locale/locale.module).
Uncaught exception thrown in session handler.
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in _drupal_session_write() (line 203 of /home/.../includes/session.inc)
This problem - "MySQL server has gone away" - can happen if the request sent to the MySQL server is too big. In fact, the problem for me was decided that I picked up in MySQL max_allowed_packet 1M setting (the default) to 32 million in my.cnf:
original
# The MySQL server
[wampmysqld]
port = 3306
socket = /tmp/mysql.sock
key_buffer = 16M
max_allowed_packet = 1M
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
basedir=d:/wamp/bin/mysql/mysql5.5.16
log-error=d:/wamp/logs/mysql.log
datadir=d:/wamp/bin/mysql/mysql5.5.16/data
solutions
settings WAMP SERVER my.ini
# The MySQL server
[wampmysqld]
port = 3306
socket = /tmp/mysql.sock
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 = 16M
basedir=c:/wamp/bin/mysql/mysql5.5.24
log-error=c:/wamp/logs/mysql.log
datadir=c:/wamp/bin/mysql/mysql5.5.24/data
max_allowed_packet = 16M
Comments
Comment #1
Chimos commentedHi,
I posted a similar issue (or maybe the same) here: http://drupal.org/node/1872098
And I posted it there, because I thought it was an Intenationalization (i18) issue.
I understand my.ini is a server config. My site is in production in a remote shared server.. Can I solve this without accessing the server / hosting admin?
I'm not sure if this is the same issue neither. I contacted the aministrators of this hosting and they told me this is a problem in my code.
Thanks
Comment #1.0
Chimos commentedDOException: SQLSTATE[HY000]: General error: 2006 MySQL Additional uncaught exception thrown while handling exception.