首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >MySQL 事务没有提交导致 锁等待 Lock wait timeout exceeded

MySQL 事务没有提交导致 锁等待 Lock wait timeout exceeded

作者头像
汤高
发布2018-03-28 12:14:16
发布2018-03-28 12:14:16
1.9K0
举报
文章被收录于专栏:积累沉淀积累沉淀

Lock wait timeout exceeded

当一个SQL执行完了,但未COMMIT,后面的SQL想要执行就是被锁,超时结束;

select * from information_schema.innodb_trx 之后找到了一个一直没有提交的只读事务,

kill 到了对应的线程后ok 了。

mysql> select * from information_schema.innodb_trx;

+--------+-----------+---------------------+-----------------------+------------------+------------+---------------------+-----------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+ | trx_id | trx_state | trx_started         | trx_requested_lock_id | trx_wait_started | trx_weight | trx_mysql_thread_id | trx_query | trx_operation_state | trx_tables_in_use | trx_tables_locked | trx_lock_structs | trx_lock_memory_bytes | trx_rows_locked | trx_rows_modified | trx_concurrency_tickets | trx_isolation_level | trx_unique_checks | trx_foreign_key_checks | trx_last_foreign_key_error | trx_adaptive_hash_latched | trx_adaptive_hash_timeout | +--------+-----------+---------------------+-----------------------+------------------+------------+---------------------+-----------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+ | F663B  | RUNNING   | 2016-11-09 10:15:52 | NULL                  | NULL             |         10 |               14310 | NULL      | NULL                |                 0 |                 0 |                7 |                  1248 |               4 |                 3 |                       0 | REPEATABLE READ     |                 1 |                      1 | NULL                       |                         0 |                      9999 | +--------+-----------+---------------------+-----------------------+------------------+------------+---------------------+-----------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+ 1 row in set mysql> kill 14310 ; Query OK, 0 rows affected mysql> 

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档