解决pymysql.err.OperationalError: (1040, ‘Too many connections‘)
一、查看 mysql 状态
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set (0.00 sec)
二、 查看服务器响应的最大连接数
mysql> show global status like 'Max_used_connections';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 5 |
+----------------------+-------+
1 row in set (0.00 sec)
三、修改最大连接数:
mysql> set global max_connections=1000
还没有评论,来说两句吧...