show full processlist
show variables like '%max_connections%';
SELECT substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;
show global variables like '%wait_timeout';
set global max_connections = 1000;
set global wait_timeout=250;
本文探讨了如何使用SQL命令来查看MySQL数据库的连接数、状态和等待超时设置。通过`show full processlist`展示当前所有进程,`show variables like '%max_connections%'`获取最大连接数,以及`show global variables like '%wait_timeout'`检查等待超时时间。此外,还展示了如何调整这些参数,如将`max_connections`设置为1000和`wait_timeout`设置为250,以优化数据库性能。
1637

被折叠的 条评论
为什么被折叠?



