mysql显示进程

时间:2011-02-10 10:11:01

标签: process phpmyadmin mysql

我没有在ubuntu服务器上安装phpMyAdmin但想要显示所有已处理的mysql。我知道你可以在phpMyAdmin中做一个“show_processes”但我怎么能通过shell做呢? 感谢

2 个答案:

答案 0 :(得分:7)

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

细节:

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

如果您想通过information_schema视图获取详细信息,

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

答案 1 :(得分:0)

mysql -uuser -p -e "show full processlist"

mysql -uuser -p -e "show processlist"