码迷,mamicode.com
首页 > 数据库 > 详细

MySQL drop空表时处于Waiting for table metadata lock状态,解决办法 (出自网络)

时间:2018-02-24 14:55:58      阅读:275      评论:0      收藏:0      [点我收藏+]

标签:modified   解决   body   cts   format   sele   for   nod   running   

MySQL drop空表时处于Waiting for table metadata lock状态,简单粗暴的解决办法,原理性请看官网

1.  mysql> select concat("kill ",b.ID,";") as kill_id from information_schema.INNODB_TRX a,information_schema.PROCESSLIST b where a.trx_mysql_thread_id=b.ID and a.trx_state=‘RUNNING‘ and b.TIME >=30;

2. mysql> select concat("kill ",trx_mysql_thread_id,";") as kill_id from information_schema.INNODB_TRX where trx_lock_structs=0 and trx_weight=0 and trx_rows_locked=0 and trx_rows_modified=0 and trx_state=‘RUNNING‘;

以上两步任选其一
mysql> kill kill_id

这种办法属于治标不治本,只是临时性解决

 

MySQL drop空表时处于Waiting for table metadata lock状态,解决办法 (出自网络)

标签:modified   解决   body   cts   format   sele   for   nod   running   

原文地址:https://www.cnblogs.com/lcmemo/p/8465420.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!