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