티스토리 뷰
728x90
반응형
출처: https://hjjungdev.tistory.com/153
Mysql (Maria) Db 테이블락 확인하고 강제중지 방법.
테이블락은 어떻게 걸리는가? 보통 기본설정의 Rdbms는 Select문을 제외하고 Delete/Update/Insert문에 대해서 테이블 락을 걸게됩니다. 가령 A라는 사람이 Delete Table;의 명령문을 실행한 상태에서 커밋을
hjjungdev.tistory.com
-- 락테이블 조회
select * from information_schema.innodb_locks;
-- 대기중인 락 조회
select * from information_schema.innodb_lock_waits;
MariaDB [mysql]> select * from information_schema.innodb_locks;
+--------------------------+-------------+-----------+-----------+------------------------------+------------+------------+-----------+----------+--------------------------------------------+
| lock_id | lock_trx_id | lock_mode | lock_type | lock_table | lock_index | lock_space | lock_page | lock_rec | lock_data |
+--------------------------+-------------+-----------+-----------+------------------------------+------------+------------+-----------+----------+--------------------------------------------+
| 208974131:14625:2153:180 | 208974131 | X | RECORD | test.test | PRIMARY | 14625 | 2153 | 180 | 2100000543, '+CrPldwM2imKVZqpr2botBVtMnA=' |
| 208907691:14625:2153:180 | 208907691 | X | RECORD | test.test | PRIMARY | 14625 | 2153 | 180 | 2100000543, '+CrPldwM2imKVZqpr2botBVtMnA=' |
kill 208974131
728x90
반응형
'리눅스 > MySQL' 카테고리의 다른 글
[MySQL] NULLIF (0) | 2022.09.27 |
---|---|
[MySQL] UNION Order by 주의점 (0) | 2022.09.27 |
[MySQL] SQL Error [1068] [42000]: (conn=231646) Multiple primary key defined (0) | 2022.07.19 |
[MySQL] WHERE 절 2개의 컬럼 IN (0) | 2022.04.04 |