错误:mysql 1213 deadlock found when trying to get lock try restarting transaction

image.png

1.检查被占用的表:

show OPEN TABLES where In_use > 0;

2.显示进程:

show processlist;

3.杀死挂起的进程即导致表锁死的进程:

kill 17909;---17909是进程的id