Mysql连接数过多,应急处理方法 |
发表者:admin分类:数据库2020-12-31 11:57:35 阅读[770] |
root@localhost > show processlist;
…...
1001 rows in set (0.00 sec)
root@localhost > show variables like '%proces%';
Empty set (0.00 sec)
root@localhost > show global status like 'Max_used_connections';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 1001 |
+----------------------+-------+
1 row in set (0.00 sec)
root@localhost > select concat('KILL ',id,';') from information_schema.processlist where user=’sam' into outfile '/tmp/a.txt
+------------------------+
| concat('KILL ',id,';') |
+------------------------+
| KILL 31964612; |
| KILL 31964609; |
| KILL 31964611; |
…...
| KILL 31966619; |
| KILL 31966620; |
+------------------------+
991 rows in set (0.02 sec)
root@localhost >
root@localhost > source /tmp/a.txt
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
……
root@localhost > show processlist;
mysql> set GLOBAL max_connections=2000;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%max_connections%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 2000 |
+-----------------+-------+
1 row in set (0.00 sec)
转载请标明出处【Mysql连接数过多,应急处理方法】。
《www.micoder.cc》
虚拟化云计算,系统运维,安全技术服务.
Tags: | [阅读全文...] |
最新评论