springboot项目操作mysql出现锁表问题情况

19 阅读1分钟

image.png

@[TOC]

情景发生说明

我在使用cron定时器每10s更新一次mysql数据库,由于操作过于频繁,导致出现锁表问题,及无法操作数据库且会报错。

解决方案

具体查看:blog.csdn.net/weberhuangx…

SELECT * FROM information_schema.innodb_trx
SELECT * FROM information_schema.innodb_locks 
SELECT * FROM information_schema.innodb_lock_waits
kill 19692

具体就是先执行sql:SELECT * FROM information_schema.innodb_trx 查看哪个进程锁了直接kill 进程号即可

image.png

重要信息

image.png

image.png

image.png