mssql 쓸 때는 ssms(sql server management studio) 라는 툴만 사용해서 몰랐는데 mysql 에 console 로 작업하려니 죽을 맛이다. 물런 mysql 도 workbench 나 유료 툴인 sqlyog 이 있지만 서버 장비에 작업 pc 로 vpn 이용하더라도 접근할 수 없다. :(

시간이 오래 걸리는 쿼리를 돌렸는데 mysql 프로세스는 열일 중이었지만 어떤 상태인지 궁금했다. mysql process 상태를 볼 때는 show processlist 를 사용한다.

mysql> show processlist;
+----+------+----------------+------+---------+------+----------+------------------+
| Id | User | Host           | db   | Command | Time | State    | Info             |
+----+------+----------------+------+---------+------+----------+------------------+
|  7 | root | localhost:6576 | NULL | Sleep   |  122 |          | NULL             |
|  8 | root | localhost:6577 | NULL | Sleep   |  122 |          | NULL             |
|  9 | root | localhost:7356 | NULL | Query   |    0 | starting | show processlist |
+----+------+----------------+------+---------+------+----------+------------------+
3 rows in set (0.00 sec)

쿼리를 실행하면 State 와 Info 를 통해 상태를 확인할 수 있다. 여러 줄의 쿼리일 경우 Info 에 실행중인 쿼리가 표시된다.

728x90

+ Recent posts