ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
解决办法:
查看sleep的进程
MySQL> show full processlist;
+-------+----------+-------------------+----------+---------+-------+----------+-----------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+----------+-------------------+----------+---------+-------+----------+-----------------------------------------------------------------------------+
| 32579 | official | 127.0.0.1:42690 | official | Sleep | 20926 | | NULL |
| 32715 | erp | 127.0.0.1:2078 | NULL | Sleep | 4570 | | NULL |
| 32716 | erp | 127.0.0.1:2079 | erp | Sleep | 3590 | | NULL |
| 32717 | erp | 127.0.0.1:2080 | erp | Sleep | 3577 | | NULL |
| 32732 | erp | 127.0.0.1:2081 | erp | Sleep | 3590 | | NULL |
| 32733 | erp | 127.0.0.1:2082 | NULL | Sleep | 1412 | | NULL |
| 32734 | erp | 127.0.0.1:2083 | erp | Sleep | 1160 | | NULL |
| 32735 | erp | 127.0.0.1:2084 | erp | Sleep | 985 | | NULL |
| 32736 | erp | 127.0.0.1:2085 | erp | Sleep | 1160 | | NULL |
| 32739 | erp | 127.0.0.1:2088 | erp | Sleep | 695 | | NULL |
| 32740 | erp | 127.0.0.1:2089 | erp | Sleep | 768 | | NULL |
| 32741 | erp | 127.0.0.1:2090 | erp | Sleep | 688 | | NULL |
| 32742 | erp | 127.0.0.1:2091 | erp | Sleep | 686 | | NULL |
| 32743 | erp | 127.0.0.1:2092 | erp | Sleep | 687 | | NULL |
| 32745 | erp | 127.0.0.1:2093 | erp | Sleep | 686 | | NULL |
| 32746 | erp | 127.0.0.1:2094 | erp | Sleep | 686 | | NULL |
| 32763 | root | localhost | erp | Query | 0 | starting | show full processlist |
| 32765 | erp | 127.0.0.1:58216 | erp | Sleep | 18 | | NULL |
| 32766 | erp | 127.0.0.1:58218 | erp | Sleep | 41 | | NULL |
| 32767 | erp | 127.0.0.1:58220 | erp | Sleep | 41 | | NULL |
| 32768 | erp | 127.0.0.1:58222 | erp | Sleep | 41 | | NULL |
| 32769 | erp | 127.0.0.1:58224 | erp | Sleep | 2 | | NULL |
| 32770 | erp | 127.0.0.1:2106 | NULL | Sleep | 153 | | NULL |
| 32771 | erp | 127.0.0.1:2107 | erp | Sleep | 148 | | NULL |
| 32772 | erp | 127.0.0.1:2108 | erp | Query | 18 | updating | UPDATE `erp_user` SET `pwd`='OyUHgt21gTP2/5uFgbKZtq==' WHERE (`id`='10113') |
+-------+----------+-------------------+----------+---------+-------+----------+-----------------------------------------------------------------------------+