收到报警,mysql的从数据库在同步的过程出现问题,已停止同步。

mysql> show slave status\G

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.199.50

Master_User: replication

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000381

Read_Master_Log_Pos: 625068573

Relay_Log_File: mysql-zhaowei-bj-199-52-relay-bin.000577

Relay_Log_Pos: 542496522

Relay_Master_Log_File: mysql-bin.000381

Slave_IO_Running: Yes

Slave_SQL_Running: No

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 1205

Last_Error: Error 'Lock wait timeout exceeded; try restarting transaction' on query. Default database: 'v506'. Query: 'update account_log set createById=806378,createTime='2013-03-01 18:41:23.0',lastLogin='2015-01-14 11:04:53',lastPost=null,loginTimes=419,sessionId=null,machineCode=null,accountIP='123.133.132.196',accountBrowser=null,lastAccessed='web',lastTimezone=null,continuous=2 where accountId=806378'

Skip_Counter: 0

Exec_Master_Log_Pos: 542496377

Relay_Log_Space: 625068934

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: NULL

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_IO_Error:

Last_SQL_Errno: 1205

Last_SQL_Error: Error 'Lock wait timeout exceeded; try restarting transaction' on query. Default database: 'v506'. Query: 'update account_log set createById=806378,createTime='2013-03-01 18:41:23.0',lastLogin='2015-01-14 11:04:53',lastPost=null,loginTimes=419,sessionId=null,machineCode=null,accountIP='123.133.132.196',accountBrowser=null,lastAccessed='web',lastTimezone=null,continuous=2 where accountId=806378'

1 row in set (0.00 sec)

经查询:

mysql> show engine innodb status\G

*************************** 1. row ***************************

Type: InnoDB

Name:

Status:

=====================================

150114 11:34:27 INNODB MONITOR OUTPUT

=====================================

Per second averages calculated from the last 18 seconds

----------

SEMAPHORES

----------

OS WAIT ARRAY INFO: reservation count 35531892, signal count 35529980

Mutex spin waits 0, rounds 24045693, OS waits 327309

RW-shared spins 79151793, OS waits 35122704; RW-excl spins 774165, OS waits 46983

------------

TRANSACTIONS

------------

Trx id counter 2 146598135

Purge done for trx's n:o < 2 146596925 undo n:o < 0 0

History list length 9

LIST OF TRANSACTIONS FOR EACH SESSION:

---TRANSACTION 2 146598134, not started, process no 14634, OS thread id 1179748672

MySQL thread id 28277, query id 1416247560 192.168.199.15 box

---TRANSACTION 0 0, not started, process no 14634, OS thread id 1097562432

MySQL thread id 28212, query id 1416247561 localhost root

show engine innodb status

---TRANSACTION 2 146597653, not started, process no 14634, OS thread id 1097828672

MySQL thread id 28028, query id 1416245550 192.168.199.15 skst

---TRANSACTION 2 146596927, not started, process no 14634, OS thread id 1098119488

MySQL thread id 27580, query id 1416245550 192.168.199.15 skst

---TRANSACTION 2 142726949, not started, process no 14634, OS thread id 1180014912

MySQL thread id 26261, query id 1416246087 192.168.199.15 skst

---TRANSACTION 0 0, not started, process no 14634, OS thread id 1096763712

MySQL thread id 26260, query id 1416246087 192.168.199.15 skst

---TRANSACTION 2 146596928, ACTIVE 1267 sec, process no 14634, OS thread id 1097029952 fetching rows, thread declared inside InnoDB 363

mysql tables in use 2, locked 1

31574 lock struct(s), heap size 3078128, 3333275 row lock(s)

MySQL thread id 27581, query id 1414544397 192.168.199.15 skst Copying to tmp table

select machineCode,createTime,accountIp from account_log where  machineCode in (select distinct machineCode from account_log where market regexp "FirstTimeForiPhone" and machineCode is not null)

Trx read view will not see trx with id >= 2 146596929, sees < 2 146494817

解决如下:

mysql> show full processlist;

+-------+-------------+----------------------+------+---------+---------+----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

| Id    | User        | Host                 | db   | Command | Time    | State                            | Info                                                                                                                                                                                               |

+-------+-------------+----------------------+------+---------+---------+----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

|     1 | system user |                      | NULL | Connect | 1907304 | Waiting for master to send event | NULL                                                                                                                                                                                               |

| 26260 | skst        | 192.168.199.15:35845 | v506 | Sleep   |     398 |                                  | NULL                                                                                                                                                                                               |

| 26261 | skst        | 192.168.199.15:35846 | v506 | Sleep   |     398 |                                  | NULL                                                                                                                                                                                               |

| 27580 | skst        | 192.168.199.15:57148 | v506 | Sleep   |     481 |                                  | NULL                                                                                                                                                                                               |

| 27581 | skst        | 192.168.199.15:57149 | v506 | Query   |    1420 | Copying to tmp table             | select machineCode,createTime,accountIp from account_log where  machineCode in (select distinct machineCode from account_log where market regexp "FirstTimeForiPhone" and machineCode is not null) |

| 28028 | skst        | 192.168.199.15:60202 | v506 | Sleep   |     481 |                                  | NULL                                                                                                                                                                                               |

| 28212 | root        | localhost            | NULL | Query   |       0 | NULL                             | show full processlist                                                                                                                                                                              |

| 28369 | box         | 192.168.199.15:63407 | v506 | Sleep   |       0 |                                  | NULL                                                                                                                                                                                               |

+-------+-------------+----------------------+------+---------+---------+----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

8 rows in set (0.00 sec)

mysql> kill 27581

-> ;

Query OK, 0 rows affected (0.00 sec)

mysql> show full processlist;

+-------+-------------+----------------------+------+---------+---------+----------------------------------+-----------------------+

| Id    | User        | Host                 | db   | Command | Time    | State                            | Info                  |

+-------+-------------+----------------------+------+---------+---------+----------------------------------+-----------------------+

|     1 | system user |                      | NULL | Connect | 1907317 | Waiting for master to send event | NULL                  |

| 26260 | skst        | 192.168.199.15:35845 | v506 | Sleep   |     411 |                                  | NULL                  |

| 26261 | skst        | 192.168.199.15:35846 | v506 | Sleep   |     411 |                                  | NULL                  |

| 27580 | skst        | 192.168.199.15:57148 | v506 | Sleep   |     494 |                                  | NULL                  |

| 28028 | skst        | 192.168.199.15:60202 | v506 | Sleep   |     494 |                                  | NULL                  |

| 28212 | root        | localhost            | NULL | Query   |       0 | NULL                             | show full processlist |

| 28376 | box         | 192.168.199.15:63414 | v506 | Sleep   |       0 |                                  | NULL                  |

+-------+-------------+----------------------+------+---------+---------+----------------------------------+-----------------------+

mysql> start slave;

Query OK, 0 rows affected (0.00 sec)

mysql> show slave status\G

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.199.50

Master_User: replication

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000381

Read_Master_Log_Pos: 643933828

Relay_Log_File: mysql-zhaowei-bj-199-52-relay-bin.000577

Relay_Log_Pos: 643933973

Relay_Master_Log_File: mysql-bin.000381

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 0

Last_Error:

Skip_Counter: 0

Exec_Master_Log_Pos: 643933828

Relay_Log_Space: 643934189

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: 0

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_IO_Error:

Last_SQL_Errno: 0

Last_SQL_Error:

1 row in set (0.01 sec)

问题解决!~

转载于:https://blog.51cto.com/netspace/1603849

数据库 1205 Error 'Lock wait timeout exceeded; try restarting transaction' on query相关推荐

  1. ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

    前言:朋友咨询我说执行简单的update语句失效,症状如下: mysql> update order_info  set province_id=15  ,city_id= 1667  wher ...

  2. 关于MySQL出现`lock wait timeout exceeded; try restarting transaction` 的解决方案

    关于MySQL出现lock wait timeout exceeded; try restarting transaction 的解决方案. 一.问题抛出 在做查询语句时,MySQL 抛出了这样的异常 ...

  3. 关于MySQL出现锁等待lock wait timeout exceeded; try restarting transaction 的解决方案

    关于MySQL出现lock wait timeout exceeded; try restarting transaction 的解决方案. 一.问题抛出 在做查询语句时,MySQL 抛出了这样的异常 ...

  4. mysql 中lock wait_应用中MYSQL 报错Lock wait timeout exceeded; try restarting transaction

    最近开发的应用开始做性能测试.在小于80用户并发的时候一切OK,并发量到100用户时,持续压5分钟.应用开始报错,并且只有1次错误,持续时间长,比如10分钟,会报3次. 日志如下: Caused by ...

  5. mysql死锁释放时间参数_【Mysql】mysql 事务未提交导致死锁 Lock wait timeout exceeded; try restarting transaction 解决办法...

    问题场景 问题出现环境: 1.在同一事务内先后对同一条数据进行插入和更新操作: 2.多台服务器操作同一数据库: 3.瞬时出现高并发现象: 不断的有一下异常抛出,异常信息: org.springfram ...

  6. 'Lock wait timeout exceeded; try restarting transaction'问题

    OperationalError: (1205, 'Lock wait timeout exceeded; try restarting transaction') 原因很简单,太多错误,意外处理没有 ...

  7. 【问题解决:死锁】Lock wait timeout exceeded; try restarting transaction的问题

    执行数据删除操作时一直超时并弹出Lock wait timeout exceeded; try restarting transaction错误 解决办法 1.先查看数据库的事务隔离级别 select ...

  8. Lock wait timeout exceeded; try restarting transaction

    排查过程: 查看数据库 INNODB_LOCKS,未发现有死锁的记录. 查看 SHOW PROCESSLIST; 也未见异常进程: 通过Mysql的控制台,查询慢日志,也未找到有关此表的Mysql慢日 ...

  9. java lock wait_java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction

    在开发测试过程中发现出了这个问题: RECHARGE:业务,数据: {"platformUserNo":"RPD_1512632756191","am ...

最新文章

  1. setHasOptionsMenu
  2. windows无法连接到打印机 操作失败,错误为0x00000002 解决方案
  3. background-size:cover IE8
  4. 谈中型项目下的编码技巧二
  5. SpringBoot之Servlet、Filter、Listener配置
  6. MapReduce的编程规范
  7. AndroidAnnotations开发框架在Eclipse中的搭建和使用以及框架实现的原理
  8. 池流程图_干货收藏 | Java程序员必备的一些流程图
  9. SQL Server数据库连续集成(CI)最佳实践以及如何实现它们–测试,处理和自动化
  10. js laypage mysql_laypage 物理分页与逻辑分页实例
  11. 如何申请微信H5支付?
  12. 小白学 Python 数据分析(8):Pandas 数据透视表(pivot_table)
  13. 2022年8种高级威胁预测出炉、FBI就零日漏洞发出警报|11月22日全球网络安全热点
  14. String的intern()详解
  15. allow php templates,PHP 返利网 自动返利支持多个电商网站 源码+程序
  16. iPhone蓝牙回控,iPhone手机互联,认证
  17. IDEA TODO标签使用
  18. vue3+ts+vite 路径别名配置
  19. 那些英年早逝的 IT 劳模们
  20. sql优化和索引常见的面试题(面试总结)

热门文章

  1. -m commit git_走在前沿的弄潮儿,怎能不会Git的那些奇技淫巧
  2. 低头是家和月光,抬头是车和远方
  3. 赛道公布之后,让我们一起DISS组委会
  4. 关于召开全国大学生智能车竞赛--百度智慧交通项目 培训通知(华中站)
  5. 无线信标功能初步测试
  6. 普大喜奔:沁恒单片机免费样品申请开始啦!
  7. 电灯泡内通有交流电,为什么看不到灯泡在闪烁?
  8. 英飞凌单片机TC264实战攻略
  9. 生命周期共有那几个阶段_一文搞懂ReactNative生命周期的进化
  10. python异常处理类源码_Flask源码异常处理问题