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

140724 18:41:26 [Warning] IP address ‘172.16.18.217‘ could not be resolved: Temporary failure in name resolution

140724 18:41:26 [Warning] IP address ‘172.16.18.217‘ could not be resolved: Temporary failure in name resolution

140724 18:41:27 [Warning] IP address ‘172.16.18.217‘ could not be resolved: Temporary failure in name resolution

140724 18:41:28 [Warning] IP address ‘172.16.18.217‘ could not be resolved: Temporary failure in name resolution

140724 18:41:28 [Warning] IP address ‘172.16.18.217‘ could not be resolved: Temporary failure in name resolution

140724 18:41:28 [Warning] IP address ‘172.16.18.217‘ could not be resolved: Temporary failure in name resolution

140724 18:41:28 [Warning] IP address ‘172.16.18.217‘ could not be resolved: Temporary failure in name resolution

140724 18:44:54 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:54 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:54 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:54 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:54 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:55 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:55 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:55 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

140724 18:44:55 [Warning] IP address ‘61.143.209.110‘ could not be resolved: Temporary failure in name resolution

问题产生的原因:

出现错误的原因是MYSQL Server在本地内存中维护了一个非本地的Client TCP cache。这个cache中包括了远程Client的登录信息,比方IP地址。hostname等信息。

假设Client连接到server后,Mysql首先会在本地TCP池中依据IP地址解析client的hostname或者反解析,假设解析不到。就会去DNS中进行解析,假设还是解析失败

就是在error log中写入这种警告信息。

解决的办法:

1.能够通过两个參数来disable这个功能,在MYSQL的配置文件里[mysqld]中增加以下的參数:

[mysqld]

--skip-host-cache

--skip-name-resolve

又一次授权,将全部訪问数据库server的授权方式都改成IP形式的。

grant all on *.* to ‘root’@’172.16.12.68’identified by ‘123456’;

2.加入授权。

将全部訪问数据库server的授权方式都改成IP形式。

不同的用户用不同的username和password。

grant all on *.* to ‘user_68’@’172.16.12.68’identified by ‘pwd_68’;

grant all on *.* to ‘user_67’@’172.16.12.67’identified by ‘pwd_67’;

....

然后去 mysql数据库以下的 user表  和db表 以下删除掉那些含有含有主机名字的权限记录。

总结:

1.要么加上

--skip-host-cache

--skip-name-resolve

使得MySQL将不再通过DNS解析地址。

2.要么在赋予权限的时候 直接用ip地址,去掉那些用主机名字的权限。

时间: 2024-11-04 23:29:09

IP address could not be resolved: Temporary failure in name resolution的相关文章

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 i

Parrot Temporary failure in name resolution

问题 ping www.baidu.com 出现 Resolving www.baidu.com... failed: Temporary failure in name resolution. 尝试root权限下修改 /etc/resolv.conf ,但失败,提示:"resolv.conf" E212: Can't open linked file for writing 现场 网络是通的 ping ip 是正常的 未对网络设置代理.dns之类操作 解决方案 1, sudo rm

SpringBoot之解决云服务器VPS在所处云端集群的内网不能解析域名的问题:java.net.UnknownHostException:abc.cn: Temporary failure in name resolution

一.起因与原因分析过程 前端同学告诉我,说服务器崩了. 请求数据接口,接口有响应,但报的json提示指向:数据库异常错误. 遂登陆云主机查看日志,核心记录显示如下: 2018-11-09 22:15:53.824 ERROR 26088 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization. com.mysql.jdbc.exceptions.jdbc

Temporary failure in name resolution

最近在使用yum方式安装perl-DBD-MySQL时碰到了Temporary failure in name resolution,Trying other mirror.即命名解析失败,尝试使用其它镜像.由于本机为最近安装的新服务器,下面是这个问题的现象描述及处理过程. 1.故障现象###当前环境[[email protected] ~]# cat /etc/issueCentOS release 5.11 (Final)Kernel \r on an \m [[email protecte

ssh: Could not resolve hostname git.*****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly

问题出现的情景:使用git pull拉取开发的代码到测试服务器,报错: ssh: Could not resolve hostname git.****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly 解决: 1.确定本地的ssh相关的文件是正确的(参考[本地服务器配置Git]) 2.尝试了网上的方法,不是没root权限无法执行就是没解决问题,后来找运维解决了 原因

运行ntpdate报错:Temporary failure in name resolution

发现问题: 忽然发现某台机器时间慢了些几分钟,之前没有搭建ntpd服务,目前都是使用的ntpdate加定时任务进行时间同步.直接执行ntpdate报错如下: # ntpdate cn.pool.ntp.orgExiting, name server cannot be used: Temporary failure in name resolution (-3) 3 Sep 15:46:46 ntpdate[13742]: name server cannot be used: Temporar

启动hadoop时候报错:localhost: ssh: Could not resolve hostname localhost: Temporary failure in name resolution”

这个错误是由于配置文件没有配置好.解决方案如下: 1 打开profile文件 vim /etc/profile 2 在文件最后加入的内容应该如下(高亮的两句一般是大家缺少的): export JAVA_HOME=/usr/java/jdk export HADOOP_HOME=/itcast/hadoop-2.6.4 export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/nativeexport HADOOP_OPTS="-Djava.libr

Temporary failure in name resolutionf的解决方法

Linux有时还蛮烦的这个不能用那个不能用,只能多折腾了. 今天又是,ping z.cn的时候直接报错 Temporary failure in name resolutionf 这个一般都知道是DNS的问题. 直接奔目标文件去修改就好了 vim /etc/resolv.conf 文件里的内容一般都是 nameserver 8.8.8.8 加上个你能用的 比如 nameserver 114.114.114.114 什么的,之后reboot即可. Temporary failure in name

在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