首页 > 数据库技术 > 详细

mysql IP address could not be resolved

时间:2014-08-28 17:05:31      阅读:284      评论:0      收藏:0      [点我收藏+]
  1. 部署了discuz ,但是页面响应太慢。

  2. apache 调成debug 级别看日 (httpd.conf 里设置)

    Apache 没问题,自己写的php,html 页面访问响应都很快。

  3. 看数据库日志  是数据存储目录下 localhost.localdomain.err

    看到 如下 错误

  4. 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

原文:http://my.oschina.net/u/234018/blog/307637

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!