Mysql too many connections


Mysql too many connections

  • 修改 /etc/mysql/my.cnf (ubuntu) /etc/my.cnf (其他Linux)

修改或添加如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
[mysqld]
port=3306
#socket=MySQL
#skip-locking
#key_buffer=16K
#max_allowed_packet=1M
#thread_stack=64K
#table_cache=4
#sort_buffer=64K
#net_buffer_length=2K
max_connections=1000
wait_timeout=300
  • 重启Mysql
1
sudo service mysql restart