首页 > 代码库 > mysql IP address could not be resolved
mysql IP address could not be resolved
部署了discuz ,但是页面响应太慢。
apache 调成debug 级别看日 (httpd.conf 里设置)
Apache 没问题,自己写的php,html 页面访问响应都很快。
看数据库日志 是数据存储目录下 localhost.localdomain.err
看到 如下 错误
2014-08-28 11:00:59 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution
网上查了下 ,说是mysql 域名解析的原因引起的
我当时 是在 /etc/hosts
里添加了当前ip 地址,对应一个域名
192.168.2.241 test_1.smart.com.cn
然后重启apache 访问就很快了。
网上说在mysql 配置文件 my.cnf
[mysqld] #stop yu ming jie xi #-skip-host-cache skip-name-resolve
这样修改后,以后添加新用户要注意了。要配置ip 地址,不能使域名,或者授权
mysql> select host,user from mysql.user; +-----------------------+--------+ | host | user | +-----------------------+--------+ | % | discuz | | 127.0.0.1 | root | | ::1 | root | | localhost | | | localhost | root | | localhost.localdomain | | | localhost.localdomain | root | +-----------------------+--------+
mysql IP address could not be resolved
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。