这篇文章主要介绍“报错mysqldump Error 3024: Query execution was interrupted怎么解决”,在日常操作中,相信很多人在MySQL报错mysqldump Error 3024: Query execution was interrupted怎么解决问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”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库,发现同样问题:
https://bugs.mysql.com/bug.php?id=83339
原因是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 ... 是不被作用的。
免责声明:本站发布的内容(图片、视频和文字)以原创、来自本网站内容采集于网络互联网转载等其它媒体和分享为主,内容观点不代表本网站立场,如侵犯了原作者的版权,请告知一经查实,将立刻删除涉嫌侵权内容,联系我们QQ:712375056,同时欢迎投稿传递力量。
Copyright © 2009-2022 56dr.com. All Rights Reserved. 特网科技 特网云 版权所有 特网科技 粤ICP备16109289号
域名注册服务机构:阿里云计算有限公司(万网) 域名服务机构:烟台帝思普网络科技有限公司(DNSPod) CDN服务:阿里云计算有限公司 百度云 中国互联网举报中心 增值电信业务经营许可证B2
建议您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流浏览器浏览本网站