今、どんなクエリが動いているかは次のコマンドで確認できる
mysql -u abcuser -pPASS abcdb -e "show processlist;"
+----+---------+-----------+-------+---------+------+----------------+--------------------------------------------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+---------+-----------+-------+---------+------+----------------+--------------------------------------------------------+ | 58 | abcuser | localhost | abcdb | Query | 2 | Writing to net | select * from T_TESTRESULTHISTDISP where ERRORCODE!="" | | 59 | abcuser | localhost | abcdb | Query | 0 | NULL | show processlist | +----+---------+-----------+-------+---------+------+----------------+--------------------------------------------------------+
Timeの単位は 秒
watchコマンドで見るときは全体で囲って -t をつけること
watch -n10 'mysql -u abcuser -pPASS abcdb -t -e "show processlist;"'