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   |
+-----------------------+--------+
时间: 2024-12-18 00:36:25

mysql IP address could not be resolved的相关文章

IP address could not be resolved: Temporary failure in name resolution

今早发现mysql日志中有非常多例如以下的警告: 140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution 140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution

ERROR 2003 (HY000): Can't connect to MySQL server on 'ip address' (111)的处理办法

远程连接mysql数据库时可以使用以下指令 mysql -h 192.168.1.104 -u root -p 如果是初次安装mysql,需要将所有/etc/mysql/内的所有配置文件的bind-address=127.0.0.1全都注释掉 [mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3

在windows下运行docker的问题【Error getting IP address: ***】

环境配置系统:windows 10docker:Docker Toolbox https://www.docker.com/products/docker-toolbox 问题描述windows下安装完Docker Toolbox后运行Docker Quickstart Terminal可能会看到如下错误 Creating Machine default... Running pre-create checks... Creating machine... Error creating mach

Java Regex match IP address

Reference: [1] https://www.mkyong.com/regular-expressions/how-to-validate-ip-address-with-regular-expression/ import java.util.regex.Matcher; import java.util.regex.Pattern; public class IPAddressValidator{ private Pattern pattern; private Matcher ma

router 分配ip address(dhcp)和dhcp中继

路由器的主要功能是网络寻址,有时候也需要用来分配ip地址.但用路由器分配地址又会加大路由器的负载,所以,有的时候我们可以把分配地址的工作交给一台PC. 1.使用router分配ip address: Router>en Router#conf t Enter configuration commands, one per line.  End with CNTL/Z. Router(config)#int vlan 1 Router(config-if)#ip dhcp pool vlan1  

poj2105 IP Address(简单题)

题目链接:http://poj.org/problem?id=2105 Description Suppose you are reading byte streams from any device, representing IP addresses. Your task is to convert a 32 characters long sequence of '1s' and '0s' (bits) to a dotted decimal format. A dotted decima

Debian static ip address

1 // /etc/network/interfaces 2 auto eth0 3 iface eth0 inet static 4 address <Your ip address> 5 netmask <Your netmask> 6 gateway <Your gateway address> 7 broadcast <Your broadcast address> 8 9 // /etc/resolv.conf 10 nameserver <

If application data needs to be sent to IP address xx.xx.xx.xx, how does it work in underneath network?

This is to illustrate the communication between two separate machines which don't have a direct physical connection. Application data is generated and passed to layer 3 (network layer) which wrapps up the data with the destination IP address. Then ha

Bringing up interface eth0: Determining if ip address 10.109.67.81 is already in use for device eth0...

重启网卡出现提示: Bringing up interface eth0:  Determining if ip address 10.109.67.81 is already in use for device eth0...                                                            [  OK  ] Bringing up interface eth1:  Determining if ip address 10.109.67.83