zoukankan      html  css  js  c++  java
  • Lock wait timeout exceeded; try restarting transaction

    What gives this away is the word transaction. It is evident by the statement that the query was attempting to change at least one row in one or more InnoDB tables.
    
    Since you know the query, all the tables being accessed are candidates for being the culprit.
    
    From there, you should be able to run SHOW ENGINE INNODB STATUSG
    
    You should be able to see the affected table(s)
    
    You get all kinds of additional Locking and Mutex Information.
    
    Here is a sample from one of my clients:'
    
    
    You should consider increasing the lock wait timeout value for InnoDB by setting the innodb_lock_wait_timeout, default is 50 sec
    
    mysql> show variables like 'innodb_lock_wait_timeout';
    +--------------------------+-------+
    | Variable_name            | Value |
    +--------------------------+-------+
    | innodb_lock_wait_timeout | 50    |
    +--------------------------+-------+
    1 row in set (0.01 sec)
    You can set it to higher value in /etc/my.cnf permanently with this line
    
    [mysqld]
    innodb_lock_wait_timeout=120
    and restart mysql. If you cannot restart mysql at this time, run this:
    
    SET GLOBAL innodb_lock_wait_timeout = 120; 
    You could also just set it for the duration of your session
    
    SET innodb_lock_wait_timeout = 120; 
    followed by your query
    
    Give it a Try !!!
  • 相关阅读:
    设计模式 --建造者模式
    HIVE
    Sqoop Mysql导入Hive完整命令参数解析
    Centos7 安装CDH6.3.2 集群
    sqlalchemy 批量插入
    前后端分离
    后台管理模板
    Springboot
    汇编基础
    百万点数据矢量切片实时聚合展示
  • 原文地址:https://www.cnblogs.com/blogsme/p/3371016.html
Copyright © 2011-2022 走看看