【MySQL】mysqldump Error 3024: Query execution was interrupted
資料庫版本:MySQL 5.7.16
mysqldump完整報錯:
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
在SELECT時也有可能報該錯:
ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
檢查bug庫,發現同樣問題:
原因是max_execution_time設定過小導致。
復現:
將max_execution_time設定成很小的值,執行mysqldump(本質也是執行SELECT)或者SELECT語句:
解決辦法:
① 透過hints,增大N值(文件說,在hints用法中,將N改為0為無限制,但我測下來不生效,可設定成一個較大值如999999解決)
SELECT /*+ MAX_EXECUTION_TIME(N) */ * FROM t1 LIMIT 100000;
② 修改max_execution_time值,將該值設定為較大一個值,或設定為0(不限制)
相關引數:
max_execution_time
該引數5.7.8被新增,單位為ms,動態引數,預設為0。
設定為0時意味著SELECT超時不被設定(不限制超時時間)。
不作用於儲存過程中的SELECT語句,並且只作用於只讀的SELECT,比如INSERT ... SELECT ... 是不被作用的。
作者微信公眾號(持續更新)
mysqldump完整報錯:
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
在SELECT時也有可能報該錯:
ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
檢查bug庫,發現同樣問題:
原因是max_execution_time設定過小導致。
復現:
將max_execution_time設定成很小的值,執行mysqldump(本質也是執行SELECT)或者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
解決辦法:
① 透過hints,增大N值(文件說,在hints用法中,將N改為0為無限制,但我測下來不生效,可設定成一個較大值如999999解決)
SELECT /*+ MAX_EXECUTION_TIME(N) */ * FROM t1 LIMIT 100000;
② 修改max_execution_time值,將該值設定為較大一個值,或設定為0(不限制)
相關引數:
max_execution_time
該引數5.7.8被新增,單位為ms,動態引數,預設為0。
設定為0時意味著SELECT超時不被設定(不限制超時時間)。
不作用於儲存過程中的SELECT語句,並且只作用於只讀的SELECT,比如INSERT ... SELECT ... 是不被作用的。
個人感覺,這個引數的新增,本意是用於幹掉執行時間過長的SELECT語句,
但這個引數可以被mysqldump所觸發,感覺是一個很雞肋的引數。
最後看了一下,該例項備份失敗,這個引數的確被人配置成了60……
作者微信公眾號(持續更新)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29773961/viewspace-2150443/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysqldump: Error 2013: Lost connection to MySQL server during query when dumpingMySqlErrorServer
- mysqldump匯出報錯"mysqldump: Error 2013 ... during query when dumping tableMySqlError
- TOP 100 long execution query
- 關聯式資料庫 Query_Execution資料庫
- mysqldump Got error: 1045MySqlGoError
- MySQL 8.0 Reference Manual(讀書筆記59節--Understanding the Query Execution Plan(2))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記58節--Understanding the Query Execution Plan(1))MySql筆記
- DZ論壇MySQL Query Error Errno:1046錯誤MySqlError
- mysqldump Got error 1290MySqlGoError
- MySQL mysqldump命令MySql
- CMU資料庫(15-445)Lab3- QUERY EXECUTION資料庫
- (十二)資料庫查詢處理之Query Execution(1)資料庫
- MSSQL2005-QUERY EXECUTION學習筆記一SQL筆記
- 【MySql】mysqldump 的用法MySql
- mysqldump: Error: Binlogging on server not activeMySqlErrorServer
- MySQL Query CacheMySql
- mysqldump: Got error: 2002: Can't connect to local MySQL server through.....MySqlGoErrorServer
- MSSQL2005-QUERY EXECUTION學習筆記之二SQL筆記
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- MYSQL-mysqldump學習MySql
- Mysql general query logMySql
- mysql 配置 General Query Log和# Slow Query LogMySql
- 【AndroidStudio】Error:Execution failed for task ':app:preDebugAndroidTestBuild'.AndroidErrorAIAPPUI
- MySQL:MTS和mysqldump死鎖MySql
- mysql 邏輯備份 (mysqldump)MySql
- mysqldump的log-error引數注意事項MySqlError
- mysql主從複製錯誤:Last_SQL_Error: Error 'Duplicate entry '327' for key 'PRIMARY'' on query. Default databa...MySqlASTError
- MySQL Rewriter Query Rewrite PluginMySqlPlugin
- mysql 大表mysqldump遷移方案MySql
- MySQL 5.5 mysqldump備份說明MySql
- Mysql不鎖表進行MysqldumpMySql
- MySQL的mysqldump工具的基本用法MySql
- mysql 備份資料庫 mysqldumpMySql資料庫
- mysql資料庫遷移 mysqldumpMySql資料庫
- adstrtal.sh報超時錯誤 ERROR : Timed out( 100000 ): Interrupted ExceptionErrorException
- RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED解決辦法ErrorDNNAI
- MySQL8.0:The General Query LogMySql
- CMU15445 (Fall 2019) 之 Project#3 - Query Execution 詳解Project