mysql无法执行source

问题背景:

1.相关系统变量当前设置

Variable_name Value
--------------------------- ----------
interactive_timeout 600
lock_wait_timeout 3600
net_read_timeout 30
net_write_timeout 60
wait_timeout 28800

 

 

Variable_name Value
------------------ ----------
max_allowed_packet 33554432   -- 32MB

 

2.article.sql文件内容,单条insert语句,文件大小337MB

 

执行

mysql> source /usr/local/src/article.sql

问题现象

 

 

 

 

 

 

2021-07-20T10:40:52前,连接10处于sleep状态;

2021-07-20T10:40:52,Aborted connection 10;

2021-07-20T10:55:20前,客户端ctrl+c无法终止source连接;

2021-07-20T10:55:20,Aborted connection 11,Aborted connection 12

2.连接状态

Id User Host db Command Time State Info
------ ------ ------------------ --------- ------- ------ -------- -----------------------
7 dba 192.168.42.1:53337 oper_test Query 0 starting show full processlist
8 dba 192.168.42.1:53338 (NULL) Sleep 2495 (NULL)
10 root localhost oper_test Sleep 513 (NULL)   -- sleep 513s

 

连接sleep 600s后

Id User Host db Command Time State Info
------ ------ ------------------ --------- ------- ------ -------- -----------------------
7 dba 192.168.42.1:53337 oper_test Query 0 starting SHOW FULL PROCESSLIST
8 dba 192.168.42.1:53338 (NULL) Sleep 3042 (NULL)

 

从当前状态重新发起source,立即报ERROR 2006 (HY000): MySQL server has gone away

 

 

 同时,服务端Got a packet bigger than 'max_allowed_packet' bytes,abort connect

 

 

 

 

 

同类问题

MySQL 一个让你怀疑人生的hang死现象

posted @ 2021-07-20 11:02  geek_ace  阅读(419)  评论(0编辑  收藏  举报