没有不值得去解决的问题,也没有不值得去学习的技术!

MySQL 5.7 Error 1206 When Emptying a Table: The Total Number of Locks Exceeds the Lock Table Size

While emptying a table in MySQL 5.7, which contained over 3 million records, the system prompted: 1206 - The total number of locks exceeds the lock tablesize when about 2 million records remained

1. While emptying a table in MySQL 5.7, which contained over 3 million records, the system prompted: 1206 – The total number of locks exceeds the lock tablesize when about 2 million records remained. See Figure 1.

While emptying a table in MySQL 5.7, which contained over 3 million records, the system prompted: 1206 - The total number of locks exceeds the lock tablesize when about 2 million records remained
Figure 1

2. Reference: THE TOTAL NUMBER OF LOCKS EXCEEDS THE LOCK TABLE SIZE.

3. This issue can be resolved by setting a higher value for the MySQL variable “innodb_buffer_pool_size”. The default value of innodb_buffer_pool_size is 8,388,608. On Windows, its location is: “C:\ProgramData\MySQL\MySQL Server 5.7\my.ini”.

4. Edit C:\ProgramData\MySQL\MySQL Server 5.7\my.ini,

Plaintext

# innodb_buffer_pool_size=8M
innodb_buffer_pool_size=16M

5. In Computer Management – Services and Applications – Services, locate MySQL57 and restart it. See Figure 2.

In Computer Management - Services and Applications - Services, locate MySQL57 and restart it
Figure 2

6. Windows could not stop the MySQL57 service (on the local computer). Error 1053: The service did not respond to the start or control request in a timely fashion. I ultimately decided to restart the computer. See Figure 3.

Windows could not stop the MySQL57 service (on the local computer). Error 1053: The service did not respond to the start or control request in a timely fashion. I ultimately decided to restart the computer
Figure 3

7. I emptied the table again in MySQL 5.7, and it succeeded. See Figure 4.

I emptied the table again in MySQL 5.7, and it succeeded
Figure 4

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系