平凡操作数据库后导致数据库被锁住了,报错如下
org.springframework.dao.CannotAcquireLockException:
### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
### The error may exist in com/yx/modules/fy/basicInfo/mapper/FlowNumMapper.java (best guess)
### The error may involve com.yx.modules.fy.basicInfo.mapper.FlowNumMapper.updateById-Inline
### The error occurred while setting parameters
解决方案
在数据库执行
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
然后再搜索的数据中 找到 trx_mysql_thread_id 列 中的线程id
然后 执行
kill 上面找到的线程ID