Get the App
SLTechnology News&Howtos  ›  Database  › 

MySQL error mysqldump Error 3024: how to solve the problem with Query execution was interrupted

Shulou Source: shulou.com Published: 2022-05-31 18:15:44 09月30日 Update

This article mainly introduces "MySQL error mysqldump Error 3024: Query execution was interrupted how to solve". In daily operation, I believe many people have doubts about MySQL error mysqldump Error 3024: Query execution was interrupted how to solve the problem. Xiaobian consulted all kinds of information and sorted out simple and easy operation methods. I hope to answer "MySQL error mysqldump Error 3024: Query execution was interrupted How to solve the "query is helpful! Next, please follow the small series to learn together!

Database version: MySQL 5.7.16

mysqldump complete error:

mysqldump: Error: Query execution was interrupted, maximum statement execution time exceeded when trying to dump tablespaces

mysqldump: Error 3024: Query execution was interrupted, maximum statement execution time exceeded when dumping table `$tb_name` at row: 25002

It is also possible to report this error during SELECT:

ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded

Check the bug library and find the same problem:

https://bugs.mysql.com/bug.php? id=83339

The max_execution_time setting is too small.

Recurrence:

Set max_execution_time to a small value and execute mysqldump (essentially SELECT) or SELECT:

[17:23:01] root@localhost [(none)]> SET GLOBAL max_execution_time=10;

Query OK, 0 rows affected (0.00 sec)

[17:23:11] root@localhost [(none)]> SELECT * FROM test.t1 LIMIT 100000;

ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded

mysqldump -uxxx -pxxx -S -A > /tmp/a.sql

mysqldump: Error 3024: Query execution was interrupted, maximum statement execution time exceeded when dumping table `$tb_name` at row: 0

Solution:

① Increase the value of N through hints (the document says that in the use of hints, change N to 0 for unlimited, but I measured it does not take effect, can be set to a larger value such as 99999 solution)

SELECT /*+ MAX_EXECUTION_TIME(N) */ * FROM t1 LIMIT 100000;

② Modify the max_execution_time value, set it to a higher value, or set it to 0 (unlimited)

Related parameters:

max_execution_time

This parameter 5.7.8 was added in ms, dynamic parameter, default is 0.

When set to 0, it means SELECT timeout is not set (no timeout is limited).

Does not work on SELECT statements in stored procedures, and only works on read-only SELECT, such as INSERT... SELECT ... It's not going to work.

At this point, the study of MySQL error mysqldump Error 3024: Query execution was interrupted is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Tags: Learning function parameter larger more statement problem help limitation utility next method dynamic unit reason meaning data database document article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Technology macOS Redmi Huawei