View connections threads in mysql SHOW PROCESSLIST
If you want to view active connections to MySQL database server then you can use SHOW PROCESSLIST command. It will return a table with information related to each connection to mysql server. If you have privillege then you can view all the connections other wise it will only show your own processes.
SHOW PROCESSLIST :
Result from above query
ID : A unique session identification number.
User : The username of the user connected or performing the action.
Host : The host name of the user issuing the statement, if its a system user performing any task this field will be blank or NULL.
db : This is the default database user is performing the action in, if selected other wise it will be blank or NULL.
Command : It shows what this thread is doing. I will explain possible values some other time.
Time : The time in seconds, the thread is been in current state.
State : The current status of thread, it is usually null if the thread stays the same for long period of time then its a sign that some thing is wrong.
Info : This column show the innermost statement thread is executing. This column only shows the first 100 characters. To view complete statements then you can use FULL in the SHOW PROCESSLIST command.
SHOW FULL PROCESSLIST;