Mysql连接数 发表于 2017-12-07 123456789101112131415161718192021222324#查询当前连接数show status like 'Threads_connected';#查询最大连接数show variables like 'max_connections';#修改最大连接数方法一 [即时生效] 需要root权限set GLOBAL max_connections = 200;方法二 修改my.cnf文件max_connections = 200注: 最大连接数5.7版上限100000#查看连接信息 root用户可以看到所有连接信息,普通用户只能看到自己的连接信息show processlist;show processlist只能列出100条,如果要全列出使用 show full processlist+----+------+-----------------+--------+---------+------+----------+-----------------------+| Id | User | Host | db | Command | Time | State | Info |+----+------+-----------------+--------+---------+------+----------+-----------------------+| 7 | root | localhost:62599 | sakila | Sleep | 13 | | NULL || 8 | root | localhost:62600 | NULL | Sleep | 53 | | NULL || 12 | root | localhost | NULL | Query | 0 | starting | show full processlist |+----+------+-----------------+--------+---------+------+----------+-----------------------+