我有一个虚拟机(Ubuntu12.04,MySQL 5.5)运行在VMware下,专门用于托管mysql服务器。我通过内部IP连接到这台服务器。
我正在试图找出为什么我会得到mysql server has gone错误。因为这个问题,我的一个窗口机器apache停止了。我一直试图用以下参数对mysql my.cnf进行微调,但没有带来预期的结果。
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
#
# * Fine Tuning
#
wait_timeout = 180
key_buffer = 384M
max_allowed_packet = 64M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 500
table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 32M如何调试此问题?配置中缺少哪些内容以避免此错误?
发布于 2013-11-09 17:38:40
这是一个非常普遍、烦人的错误。
您可以尝试在mysql服务器端增加超时(不仅等待超时,而且连接超时也是如此).当您在mysql上手动运行查询时,您的查询运行多长时间?比你的超时时间还长?这是个问题。
它可能在应用程序端,例如,如果您使用php,如果代码击中max_execution_time 碳化硅,那么您可能会看到这个错误。
而且,mysql变量max_packet 碳化硅将导致此错误,并且通常发生在导入mysqldumps时。
最后,如果您对tcp/3306 (或mysql正在监听的任何内容)有iptables速率限制,您可能会看到这是丢包的结果。
简而言之,试着提高所有限制/超时,包括mysql侧和应用程序端,每次一个,然后重复直到修复为止。
https://serverfault.com/questions/551846
复制相似问题