mysql异常com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded

原创 2016年08月31日 12:48:03

问题场景:应用调用数据库mysql提示:
com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
; SQL []; Lock wait timeout exceeded; try restarting transaction; nested exception is
com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

处理过程:

1、尝试 SHOW PROCESSLIST; 进行kill id 发现无法kill成功;

2、关闭 mysql 服务,重启,提示:
查看 mysql.err 提示:

02:32:12 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=16384
read_buffer_size=262144
max_used_connections=0
max_threads=100
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 33293 K bytes of memory
Hope that’s ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong…
stack_bottom = 0 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x915405]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x37b)[0x650beb]
/lib64/libpthread.so.0[0x341b00eca0]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

当时判断 这有可能是 是my.cnf的配置发生导致的异常,

3、重新调整 my.cnf 的key_buffer_size ,read_buffer_size等相关参数,但是一直提示:

key_buffer_size=402653184
read_buffer_size=2097152
max_used_connections=23
max_threads=151
threads_connected=11
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1013277 K
bytes of memory
Hope that’s ok; if not, decrease some variables in the equation.

4、后来重置 my.cnf ,把my.cnf 设置为初始的my.cnf后

重启 mysql服务 ,发现日志变更为:

26573 [ERROR] /usr/local/mysql/bin/mysqld: Error writing file ‘/data0/mysqldb/pretest.pid’ (Errcode: 28 - No space left on device)
26573 [ERROR] Can’t start server: can’t create PID file: No space left on device

5、这说明当前存储空间出现问题

使用 df -sh * 和 dt -ah 查询,发现存储空间确实存在不足的问题,

处理存储空间不足的问题后,恢复 原始的my.cnf,重启mysql,问题处理成功。

相关文章推荐

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when tryin

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when tryin

Mysql常见异常

1 字段过长 com.taobao.tddl.dbsync.applier.ApplierBrokenException: com.mysql.jdbc.MysqlDataTruncation: Da...
  • arkblue
  • arkblue
  • 2013年11月15日 17:22
  • 4991

【MySQL】事务没有提交导致 锁等待Lock wait timeout exceeded异常的处理办法

java.lang.Exception: ### Error updating database.  Cause:java.sql.SQLException: Lock wait timeout ex...

java链接Mysql异常:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:

1963okcom.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The driver was unable to create a con...

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for

背景:用Eclipse+MySQL做项目的时候,从项目中保存数据   问题: 出现错误 org.springframework.transaction.TransactionSystemExc...

异常:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

当程序中出现异常提示为:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException  的时候,说明是SQL语句出现了错误,导致程序无法编译。例如...

mysql 数据库问题com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link...

mysql 数据库问题com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link...

MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:

http://zeusami.iteye.com/blog/1112827 MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdb...
  • cynhafa
  • cynhafa
  • 2014年02月22日 10:51
  • 52151

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

java.lang.Exception: ### Error updating database.  Cause: java.sql.SQLException: Lock wait timeout ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:mysql异常com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded
举报原因:
原因补充:

(最多只允许输入30个字)