MySQL 抛出 Broken Pipe 和 MySQL Server has gone away 错误。我的数据库表包含文本字段,我每隔 1 小时定期在其中插入大型 HTML。
我应该考虑设置哪个 MySQL 变量。
这是当前配置:
[mysqld]
datadir=/home/monk/mysql
socket=/home/monk/mysql/mysql.sock
user=mysql
default_time_zone='+06:00'
innodb_buffer_pool_size=35G
innodb_buffer_pool_instances=15
query_cache_type=ON
query_cache_size=64M
join_buffer_size=524288
tmp_table_size=32M
max_heap_table_size=32M
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_allowed_packet=1G
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
wait_timeout = 2000
interactive_timeout = 2000
#bind-address=127.0.0.1
##skip-networking~
最佳答案
我认为 max_allowed_packet 应该是 256MB 就足够了,你的网络连接可能很慢。也尝试以下变量。
将 net_write_timeout 设置为双倍 在拉力赛中也增加 net_buffer_length。
还有你的盒子里有多少 ram,你是不是把所有的都带到了 innodb_buffer_pool,将它设置为你的盒子 ram 的 70% 到 80%。
另一个建议是关闭查询缓存,因为它是一种网络内容。
关于mysql - 错误 : Broken Pipe/MySQL Server has gone away,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34553758/