–查看mysql状态
#service mysql status
–停止mysql
#service mysql stop
–启动mysql
#service mysql start
—当前连接数
show status like ‘Threads%’;
—查询最大连接数
show variables like ‘%max_connections%’ ;
—设置最大连接数 最大16384
set global max_connections=1000 ;
— ip占用的连接数
SELECT substring_index(host, ‘:’,1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;