MySQL Error: Error 1205 (HY000): Lock Wait timeout exceeded solution

Source: Internet
Author: User
Tags commit


Interim solution

Execute MySQL command: Show full processlist;

Then find the system ID of the INSERT statement

Execute mysql command: Kill ID

On the network to find the relevant information, here are excerpts:

First, review the process information for the database:

Show full processlist;

/* Results slightly, mainly look at the ID column value * *

Then look at the things table:

SELECT * from INFORMATION_SCHEMA. Innodb_trx\g;
/* result slightly, note the value of the trx_mysql_thread_id part of the result * *

Find the corresponding ID, then the value of the Kill ID;

MySQL is automatically submitted by default and can be viewed with the following command:

SELECT @ @autocommit;
A value of 1 is automatically submitted, if you are not 1, but you want to automatically submit, then set the command is:

Set global autocommit=1;

Table data volume is also small, according to ordinary circumstances, simple update should not cause congestion, MySQL is autocommit, will not appear update card situation, to see the value of the next autocommit.
Mysql> SELECT @ @autocommit;
+--------------+
| @ @autocommit |
+--------------+
| 0 |
+--------------+
1 row in Set (0.00 sec)


Mysql>

See the shiny 0, this setting causes the original UPDATE statement, if there is no commit, you re-execute the UPDATE statement, you will wait for the lock, when the waiting time is too long, will report the error 1205 (HY000): Lock wait Timeout exceeded; Try restarting transaction error.
So hurriedly commit the UPDATE statement just executed, then set global autocommit=1;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.