Mysql ERROR: ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction, hy000restarting

Source: Internet
Author: User

Mysql ERROR: ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction, hy000restarting

After the index was added last night, Lock wait timeout exceeded was thrown when querying the entire table; try restarting transaction. I am scared to death. Why can't I find the entire table because of the conditional query, the boss said that I added an error ..., later, I found a solution. It turned out to be a deadlock.

View database isolation levels

select @@tx_isolation;

Check the current mysql database process (whether a thread such as wait exists and kill it directly)

show full processlist

Compare the situation in the thread and check whether there are locked transaction threads.

SELECT * FROM information_schema.INNODB_TRX;

Deadlock Removal

KILL XXX

Have you ever encountered this problem, how did you solve it? I have many questions.

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.