Home > Database > Mysql Tutorial > mysql提示 Lock wait timeout exceeded解决办法

mysql提示 Lock wait timeout exceeded解决办法

WBOY
Release: 2016-06-07 17:53:16
Original
1233 people have browsed it

我的mysql报这个错 err=1205 - Lock wait timeout exceeded; try restarting transaction

利用 SHOW PROCESSLIST来查看问题


原因:原因是你使用的InnoDB   表类型的时候,
默认参数:innodb_lock_wait_timeout设置锁等待的时间是50s,
因为有的锁等待超过了这个时间,所以抱错.

你可以把这个时间加长,或者优化存储过程,事务避免过长时间的等待.


解决的办法有两个

第一:innodb_lock_wait_timeout 锁定等待时间改大

my.ini文件:

 代码如下 复制代码

#innodb_lock_wait_timeout = 50

修改为

innodb_lock_wait_timeout = 500

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template