mysql 锁 启动失败_MySQL错误:超过锁定等待超时;尝试重新启动事务 (MySQL error: Lock wait timeout exceeded; try restarting tran...

2015-05-05 17:39:11

0

We have a script that runs at 5:15am and retrieves data from 36 remote sites. A separate instance of the script runs for each site, so all 36 run at the same time. The data ranges from 400K to 1MB.

When the data comes in from the remote site, the script tries to delete rows for the same date and site id in our MySQL database and then insert the new data. We frequently get this error:

Lock wait timeout exceeded; try restarting transaction mysql

when it tries to delete the old rows. Sometimes the script just stops responding with no error message.

Does the error mean that it can't delete or insert the data because the table is locked?

How can we fix this?

Is there a way to have the delete/insert SQL queue up and wait for the table to become unlocked?

We have many other scripts that insert data from all 36 sites, but we are only having this error with 2 of our scripts. These 2 scripts happen to bring back far more data than any other script.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值