Mysql select 、update运行超时解决方案

Mysql update运行超时解决方案

问题描述:执行update时,发现时间很长,而且会失败;

步骤:

1、在数据库执行:

UPDATE play SET skip = skip+500, run = 5.50, jump_times=jump_times+1

WHERE id=388;

结果报错:

Error Code: 1205. Lock wait timeout exceeded; try restarting transaction

– 查看事物表

select * from information_schema.innodb_trx;

在结果中发现 trx_mysql_thread_id 有值 187772

运行:

show processlist;

结果中有一条187772的数据

在SQL中运行:

kill 187772;

 

参考:https://blog.csdn.net/wyyl1/article/details/80517139

posted @ 2024-04-01 16:40  Kevin_Zhou_9  阅读(102)  评论(0编辑  收藏  举报