MySQL笔记-删除session,删除阻塞任务
生活随笔
收集整理的這篇文章主要介紹了
MySQL笔记-删除session,删除阻塞任务
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
對應的關鍵字:
Waiting for table metadata lock主要的命令如下:
show processlist;kill 10086;select * from information_schema.innodb_trx\G;查processlist和kill
mysql> show processlist; +----+-----------+-----------------------+-----------+---------+------+---------------------------------+------------------------------------------------------------------------------------------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------+-----------------------+-----------+---------+------+---------------------------------+------------------------------------------------------------------------------------------------------+ | 85 | financial | DESKTOP-82CT4I6:59226 | financial | Sleep | 209 | | NULL | | 86 | root | localhost:59239 | financial | Query | 44 | Waiting for table metadata lock | Alter table `financial`.`fund_open_price_year_2021`change `fundId` `fund_id` varchar(32) CHAR | | 87 | root | localhost:59240 | NULL | Sleep | 55 | | NULL | | 89 | root | localhost:59249 | NULL | Query | 0 | starting | show processlist | +----+-----------+-----------------------+-----------+---------+------+---------------------------------+------------------------------------------------------------------------------------------------------+ 4 rows in set (0.00 sec)mysql> kill 86; Query OK, 0 rows affected (0.00 sec)查未提交的事務查詢
mysql> select * from information_schema.innodb_trx\G; *************************** 1. row ***************************trx_id: 283818627624448trx_state: RUNNINGtrx_started: 2022-02-15 15:26:30trx_requested_lock_id: NULLtrx_wait_started: NULLtrx_weight: 0trx_mysql_thread_id: 85trx_query: NULLtrx_operation_state: NULLtrx_tables_in_use: 0trx_tables_locked: 0trx_lock_structs: 0trx_lock_memory_bytes: 1136trx_rows_locked: 0trx_rows_modified: 0trx_concurrency_tickets: 0trx_isolation_level: REPEATABLE READtrx_unique_checks: 1trx_foreign_key_checks: 1 trx_last_foreign_key_error: NULLtrx_adaptive_hash_latched: 0trx_adaptive_hash_timeout: 0trx_is_read_only: 0 trx_autocommit_non_locking: 0 1 row in set (0.00 sec)ERROR: No query specifiedmysql> kill 85; Query OK, 0 rows affected (0.00 sec)總結
以上是生活随笔為你收集整理的MySQL笔记-删除session,删除阻塞任务的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: parallels desktop 缺少
- 下一篇: jsonview浏览器插件 查看格式化j