MySQL show status - active or total connections?

前端 未结 8 617
旧时难觅i
旧时难觅i 2020-11-27 09:07

When I run show status like \'Con%\' it shows the number of connections, which is 9972 and constantly growing. Is this an active number of connections or connec

8条回答
  •  情深已故
    2020-11-27 09:39

    This is the total number of connections to the server till now. To find current conection status you can use

    mysqladmin -u -p extended-status | grep -wi 'threads_connected\|threads_running' | awk '{ print $2,$4}'

    This will show you:

    Threads_connected 12
    
    Threads_running 1  
    
    Threads_connected: Number of connections
    
    Threads_running: connections currently running some sql
    

提交回复
热议问题