[mysq]ERROR 2006 (HY000) at line xx: MySQL server has gone away 解决方法

时间:2022-04-27 14:24:51

vi /etc/my.cnf

wait_timeout=2880000
interactive_timeout = 2880000
max_allowed_packet = 100M

完整配置文件

[mysqld]
#init_connect='SET collation_connection = utf8_unicode_ci'
#init_connect='SET NAMES utf8'
#character-set-server=utf8
#collation-server=utf8_unicode_ci
#skip-character-set-client-handshake
wait_timeout=2880000
interactive_timeout = 2880000
max_allowed_packet = 100M [client]
#default-character-set=utf8 [mysql]
#default-character-set=utf8 [mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid #
# include all files from the config directory
#
!includedir /etc/my.cnf.d