BrianB BrianB - 17 days ago 5
MySQL Question

mysql show processes

I don't have phpMyAdmin installed on a ubuntu server but want to show all mysql processed. I know that you can do a "show_processes" in phpMyAdmin but how can I do it via shell?
Thanks

Answer
mysql -u USER -pPASS -P PORT -h HOST < "show processlist"

details:

-u = user
-p = password
-P = port number
-h = HOST

if you want to get the details via information_schema views,

sql="select * from information_schema.processlist where ???"
mysql -u USER -pPASS -P PORT -h HOST < $sql
Comments