死锁处理流程:
show full processlist; # 获得当前所有数据库连接 select id, db, user, host, command, time, state, info from information_schema.processlist where command != 'Sleep' order by time desc\G; show engine innodb status; # 查看innodb的事务. select * from information_schema.innodb_trx;# 查找当前事务 select * from information_schema.innodb_locks;# 查找当前已经锁定的事务 select * from information_schema.innodb_lock_waits;# 查找当前等待锁的事务 # 联系业务,确定是否可杀。 kill 线程id;# 若是lock tables语句锁定,则比较麻烦