SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Created on 25 January 2024, 10 months ago

I am getting following error in application.
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS "expression" FROM "sessions" "sessions" WHERE "sid" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => UUFdRWGkjtSaQQWY2-5jcfAnQAT6-tw7ummpbCpPiCE ) in Drupal\Core\Session\SessionHandler->write() (line 87 of /var/www/***/***/******/web/core/lib/Drupal/Core/Session/SessionHandler.php).

Uploading the screenshot with complete error.
-------------
i tried to update the following to 100M from 16M in /etc/mysql/conf.d/mysqldump.cnf
root@DEVDDVM:/etc/php/8.1/apache2# cat /etc/mysql/conf.d/mysqldump.cnf
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
Also i tried updating the following in settings.local.php
From
ini_set('memory_limit', '1532M');
ini_set('max_execution_time', 900);
To
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', 1800);
-----
/etc/mysql/my.cnf contains below info
root@DEVDDVM:/var/log# cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

πŸ’¬ Support request
Status

Active

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Navnath_patil
  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    Hello, the purpose of this module is just to provide a report of the settings of your mysql server from within your Drupal admin reports page. If your are getting errors generally from your Drupal website, that is likely due to any number of configuration issues between the site and the database, and not an issue with this module. The error message you posted references the "sessions" table, which this module doesn't touch. The "MySQL server has gone away" is MySQL's generic error message and can mean many things. So I would suggest to discuss the issue you are seeing with your system or DB administrator.

Production build 0.71.5 2024