mysql IP address could not be resolved

  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   |
+-----------------------+--------+


转载于:https://my.oschina.net/tacg/blog/307637

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值