innodb_lock_wait_timeout in mysql

Published on Author bloggerzero2 Comments

What is the maximum value of innodb_lock_wait_timeout in mysql?

The maximum possible value is 63000.


Why we need to set innodb_lock_wait_timeout value in mysql?

When you run a time consuming query in mysql l (i.e: update query with joining multiple tables), we might face below errors.

Error Code: 1205 Lock
wait timeout exceeded; try restarting transaction

Error Code: 2013 Lost connection to MySQL server during query



How to set innodb_lock_wait_timeout value in mysql?

Use the below query to increase the timeout value

set innodb_lock_wait_timeout=10000;



2 Responses to innodb_lock_wait_timeout in mysql

  1. You can set it to higher value in /etc/my.cnf permanently with this line

    and restart mysql. If you cannot restart mysql at this time, run this:

    SET GLOBAL innodb_lock_wait_timeout = 10000;
    You could also just set it for the duration of your session

    SET innodb_lock_wait_timeout = 10000;
    followed by your query

Leave a Reply

Your email address will not be published. Required fields are marked *