当前位置:Gxlcms > 数据库问题 > MySQL drop空表时处于Waiting for table metadata lock状态,解决办法 (出自网络)

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

时间:2021-07-01 10:21:17 帮助过:21人阅读

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   

人气教程排行