MySQL DDL Waiting for table metadata lock 解決
原因一:表上有執行中的sql(包含:讀、寫)
show processlist 檢視錶對應的PROCESSLIST_ID
原因二:看不到執行中的sql
開啟事務
執行sql (無論是否執行成功)
未提交事務
處理方法:檢視導致阻塞的sql的 PROCESSLIST_ID,kill
SELECT
t.PROCESSLIST_ID, c.*
FROM
performance_schema.events_statements_current c,
performance_schema.threads t
WHERE c.current_schema = '庫名' AND c.sql_text LIKE "%表名%"
AND c.THREAD_ID = t.THREAD_ID;
kill $PROCESSLIST_ID
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26250550/viewspace-2790328/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL新增索引偶遇waiting for table metadata lockMySql索引AI
- MySQL表結構變更引起的Metadata Lock|如何定位DDL被阻塞MySql
- MySQL:Analyze table導致'waiting for table flush'MySqlAI
- MySQL5.7 Waiting FOR TABLE FLUSHMySqlAI
- MySQL5.7 Waiting for global read lockMySqlAI
- mysql觀測METADATA LOCK(MDL)鎖MySql
- MySQL:簡單記錄一下Waiting for commit lockMySqlAIMIT
- mysql metadata lock後設資料鎖之鎖狀態lock_status流轉圖MySql
- mysql, Lock wait timeout exceeded; try restarting 解決MySqlAIREST
- MySQL Online DDL詳解MySql
- ORA-04021: timeout occurred while waiting to lock objectWhileAIObject
- 解決:Failed to download metadata for repo ‘base‘AI
- MySQL - DDL詳解(Data Definition Language)MySql
- yum 提示 Another App is currently holding the yum lock; waiting for it to exit...APPAI
- Mysql truncate table時解決外來鍵關聯MySql
- [20190522]DISABLE TABLE LOCK.txt
- MySQL DDL操作表MySql
- MySQL DDL執行方式-Online DDL介紹MySql
- ubuntu解決Could not get lock /var/lib/dpkg/lock-frontendUbuntu
- [20190524]DISABLE TABLE LOCK(12c).txt
- [20190530]DISABLE TABLE LOCK(10g).txt
- GaussDB資料庫SQL系列-LOCK TABLE資料庫SQL
- mysql lock操作MySql
- 當匯入flutter專案時,報Waiting for another flutter command to release the startup lockFlutterAI
- MySQL8.0 binlog_row_metadataMySql
- Oracle中獲取TABLE的DDL語句的方法Oracle
- 【Bug解決】CentOS-8中“Failed to download metadata for repo ‘AppStreamCentOSAIAPP
- MySQL:理解MDL LockMySql
- MySQL Cases-記錄大量waiting for handler commitMySqlAIMIT
- mysql innodb lock鎖之record lock之一MySql
- 對比上次MySQL的DDLMySql
- MYSQL錯誤程式碼:1248 Every derived table must have its own alias 解決MySql
- MySQL 5.7從庫system lock執行緒解釋MySql執行緒
- MySQL 5.6執行DDL報錯ERROR 1050 (42S01): Table 'sms/#sql-ib752' already existMySqlError
- Swift 5 Type Metadata 詳解Swift
- 羅技鍵盤 Caps Lock 鍵 bug 解決
- mysql之 openark-kit online ddlMySql
- 04 MySQL 表的基本操作-DDLMySql