LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1239|回复: 2

关于mysql unauthenticated user 的BUG提问

[复制链接]
发表于 2005-12-30 22:43:58 | 显示全部楼层 |阅读模式
经常出现unauthenticated user 之后myql没有反应,经过查询终于发现原来是mysql的dns解析bug,也有相关的解决方法:

Yet despite my sincere efforts to break MySQL and reproduce this potential bug I cannot. Since --skip-name-resolve fixes the issue, we know the issue probably lies somewhere between sql/sql_parse.cc line 522 and line 534, the conditional block of code which is not executed when --skip-name-resolve is set. For now, this potential bug remains easily avoidable and easily worked around.

用with --skip-name-resolve 参数启动,那么是否是执行 /etc/init.d/mysql with --skip-name-resolve start来启用呢?

看到bugzilla中说 把skip-name-resolve 加入到my.cnf启动mysql也能解决,并且在/etc/hosts中添加自己已知的想要其访问mysql的地址。不知道有没有朋友做过,有相关经验请分享指教。
 楼主| 发表于 2005-12-30 22:45:17 | 显示全部楼层
[16 Jul 17:36] Paul Vernon The problem is related to the listed name

servers in your resolv.conf file.

If for whatever reason those servers cannot be contacted by your server, then
reverse dns cannot be performed.  You can do either of the following to correct
this issue:

1. Add additional secondary nameservers to your resolv.conf file
2. Add common hosts that will connect to this server to your /etc/hosts file
3. Add skip-name-resolve to your my.cnf file or startup scripts.

You should also add the hostname of the DB server you are running to each of
your Web Servers /etc/hosts file, since they are probably using the same lame
dns servers as well.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-30 22:46:09 | 显示全部楼层
[6 Jul 22:38] Rich Brome I've been having this problem as well, using MySQL 4.1.12 on

RedHat. Like
others, I'm using a private connection and IPs to connect the web and database
servers.

It was driving me mad. When it happened, (more often during peak hours, but
sometimes off-peak as well,) it was freezing Apache completely on both of my web
servers for up to five minutes, taking my site down completely. It always
corrected itself within 5 minutes, but 5-minute outages a dozen times a day was
pretty frustrating.

Lowering the connect timeout tamed the Apache lockups, but the MySQL lockups
still happened, so I then was getting streams of "Lost connection" and "Can't
connect" errors from my site.

It took me forever to finally catch an event while I was logged in to MySQL, but
then I finally did, and saw what others here described - hundreds of processes,
all stuck at "Connect".

Simply adding "skip-name-resolve" to my.cnf seems to have solved all my
problems.

I think it's a pretty serious bug that the default config will do this,
apparently whenever there are private IP addresses and high loads, which can't
be that uncommon.

不知道哪种方法解决更有效,更稳定。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表