The method of unlocking mysql Lock Table
This article mainly introduces the method of unlocking mysql lock table, which has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
What is a MySQL lock table?
In order to optimize mysql with high concurrency, it is necessary to understand the table locking mechanism when mysql queries are updated.
MySQL has three levels of locks: page level, table level, and row level.
The MyISAM and MEMORY storage engines use table-level locks (table-level locking); the BDB storage engines use page locks (page-level
Locking), but also supports table-level locks; the InnoDB storage engine supports both row-level locks and table-level locks, but row-level locks are used by default.
The characteristics of the three locks of MySQL can be roughly summarized as follows:
Table-level lock: low overhead, fast locking; no deadlock; large lock granularity, the highest probability of lock conflict and the lowest concurrency.
Row-level locks: expensive and slow to add locks; deadlocks occur; locking granularity is the smallest, the probability of lock conflicts is the lowest, and the degree of concurrency is the highest.
Page lock: the overhead and locking time are between table lock and row lock; deadlocks occur; lock granularity is between table lock and row lock, and the concurrency is general.
How to lock the watch? How to unlock the MySQL lock table?
1. Check the process, mainly to find the ID of the process whose table is locked.
SHOW PROCESSLIST
2. Kill the process ID of unlocking the table
KILL 10866 / ID of the digital real-time process following
Thank you for reading this article carefully. I hope it will be helpful for everyone to share the methods and contents of mysql lock table unlocking. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!