How can I view currently running MySQL queries?

You can use the  "show processlist" command to view currently running queries. This is useful if you are looking to see if a query is locking a table, or if you have too many open queries, or for any other number of reasons.

On a Linux Plesk server the MySQL password is stored in /etc/psa/.psa.shadow. You would view the current query list with this command:

mysql -uadmin -p´cat /etc/psa/.psa.shadow´ -e 'show processlist' 

The output will be truncated so that everything fits onto one line. If you need to view the entire query you need to run "show full processlist."

mysql -uadmin -p´cat /etc/psa/.psa.shadow´ -e 'show full processlist'

If you are not running Plesk, by default there is no password set for user root:

mysql -uroot -e 'show processlist'

This article has been provided by Codero Hosting, the leading provider of reliable dedicated, managed and cloud hosting services. Need more information on this topic or to learn more about Codero’s hosting services please visit 
www.codero.comchat with us online or give us a call at 866-2-CODERO. 

Posted in
Last update:
2015-12-03 20:39
Average rating:0 (0 Votes)