我的 VPS 经常无法“MySQL 服务器已消失(错误 2006)”并失去连接。我在 my.cnf 中增加了变量的值,但情况没有改善。这是我的.cnf:
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-storage-engine=myisam
datadir=/var/lib/mysql
old_passwords=1
skip-bdb
skip-innodb
max_allowed_packet = 256M
table_cache= 512M
wait_timeout = 180
max_connections = 2000
net_read_timeout= 180
query_cache_size = 512M
query_cache_limit = 512M
max_user_connections=300
[client]
socket=/var/lib/mysql/mysql.sock
max_allowed_packet = 128M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid