SHOW STATUS LIKE 'Threads%';
Threads_connected显示的数值就是当前的连接数

SELECT substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;

SELECT user,substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;
SHOW VARIABLES LIKE '%max_connections%';

set global max_connections=500;
也可以修改mysql配置文件max_connections=500,然后重启mysql生效
如有错误欢迎指正