Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with the problem of locking tables when mysql deletes tables

2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about mysql delete table lock table problem how to deal with the content. Xiao Bian thinks it is quite practical, so share it for everyone to make a reference. Let's follow the editor and have a look.

The method to solve the problem of locking the table when mysql deletes the table: first query whether there is a transaction being executed, if there is an uncommitted transaction, kill the transaction or wait for the transaction to commit; then re-execute the delete table operation.

Problem Description:

1, drop table when the table is locked, has been waiting.

Show Full ProcessList ; can find the waiting process.

After killing the corresponding lock, the query is unaffected.

Delete this table again and lock the table again.

Problem solving:

If there are uncommitted transactions, consider kill transactions or wait for transactions to commit.

SELECT trx_state, trx_started, trx_mysql_thread_id, trx_query FROM information_schema.innodb_trx;

Query a transaction being executed. Delete table operation after kill is normal.

Thank you for reading! How to deal with the problem of locking tables when mysql deletes tables is shared here. I hope the above content can be of some help to everyone, so that everyone can learn more knowledge. If you think the article is good, you can share it so that more people can see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 267

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report