MySQL Current Connection Query Information
You can show MySQL open database connections (and other MySQL database parameters) using the MySQL show status
command, like this:
mysql> show status like 'Conn%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | Connections | 8 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show status like '%onn%'; +--------------------------+-------+ | Variable_name | Value | +--------------------------+-------+ | Aborted_connects | 0 | | Connections | 8 | | Max_used_connections | 4 | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_finished_connects | 0 | | Threads_connected | 4 | +--------------------------+-------+ 7 rows in set (0.00 sec)
Notice that I use like 'Conn%'
in the first example to show variables that look like “Connection”, then got a little wiser in my second MySQL show status query.
MySQL show processlist
Here’s what my MySQL processlist:
mysql> show processlist; +----+------+-----------+--------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+--------+---------+------+-------+------------------+ | 3 | root | localhost | webapp | Query | 0 | NULL | show processlist | +----+------+-----------+--------+---------+------+-------+------------------+ 1 row in set (0.00 sec)
MySQL Status
Using the mysqladmin
command at the Unix/Linux command line, like this:
$ mysqladmin status Uptime: 4661 Threads: 1 Questions: 200 Slow queries: 0 Opens: 16 Flush tables: 1 Open tables: 6 Queries per second avg: 0.043
There are 0 comments