1、执行show full processlist;查看所有mysql线程
2、执行SELECT * FROM information_schema.INNODB_TRX\G;结果如下:
mysql> SELECT * FROM information_schema.INNODB_TRX\G;
*************************** 1. row ***************************
trx_id: 14CDCFB
trx_state: RUNNING
trx_started: 2015-05-13 15:26:06
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 6
trx_mysql_thread_id: 14381923
trx_query: NULL
trx_operation_state: NULL
trx_tables_in_use: 0
trx_tables_locked: 0
trx_lock_structs: 4
trx_lock_memory_bytes: 1248
trx_rows_locked: 2
trx_rows_modified: 2
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
1 row in set (0.00 sec)
ERROR:
No query specified
发现存在一条错误线程,线程id为14381923,且该id在show full processlist;的结果中状态为sleep
3、于是执行kill 14381923;
执行后恢复正常