赞
踩
1、登陆数据库所在服务器,重启mysql
service mysqld restart
2、使用命令重新登陆
-- 1、使用命令登陆mysql mysql -u root -p -- 2、输入连接密码 -- 3、查看连接数,可以发现有很多连接处于sleep状态 show processlist; -- 4、查看最大连接数 show variables like "max_connections"; -- 5、修改最大连接数 set GLOBAL max_connections=5000; -- 6、查看等待秒数 show global variables like 'wait_timeout'; -- 7、修改这个数值,这里可以随意,最好控制在几分钟内 set global wait_timeout=300; -- 8、关闭一个连接之前要等待的秒数,但是正在使用的连接到了时间也会被关闭 set global interactive_timeout=500; -- 9、 需要kill的连接id都查询出来 select concat('KILL ',id,';') from information_schema.processlist where user='root';
至此结束,留作日后参考
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。