接続セッション一覧 : show processlist;
mysql> show processlist; +-------+-----------------+-----------------+----------+---------+------+-----------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +-------+-----------------+-----------------+----------+---------+------+-----------------------------+------------------+ | 1 | event_scheduler | localhost | NULL | Daemon | 9 | Waiting for next activation | NULL | | 67692 | root | localhost | ????? | Query | 0 | starting | show processlist | | 68108 | root | 127.0.0.1:43480 | ????? | Sleep | 21 | | NULL | | 68224 | root | 127.0.0.1:43712 | ???????? | Sleep | 29 | | NULL | | 68408 | root | 127.0.0.1:45742 | ???????? | Sleep | 24 | | NULL | +-------+-----------------+-----------------+----------+---------+------+-----------------------------+------------------+ 5 rows in set (0.00 sec)
接続セッション数 : show status like ‘Threads_connected’; または SELECT COUNT(*) FROM information_schema.PROCESSLIST;
mysql> show status like 'Threads_connected'; +-------------------+-------+ | Variable_name | Value | +-------------------+-------+ | Threads_connected | 4 | +-------------------+-------+ 1 row in set (0.01 sec)
mysql> SELECT count(*) FROM information_schema.PROCESSLIST; +----------+ | count(*) | +----------+ | 5 | +----------+ 1 row in set (0.00 sec)
最大接続設定 : show global variables like ‘max_connections’;
mysql> show global variables like 'max_connections'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | ??? | +-----------------+-------+ 1 row in set (0.00 sec)