今早发现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地址,去掉那些用主机名字的权限。

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

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

    一.起因与原因分析过程 前端小伙伴儿告诉我,说服务器崩了. 请求数据接口,接口有响应,但报的json提示指向:数据库异常错误. 遂登陆云主机查看日志,核心记录显示如下: 2018-11-09 22:1 ...

  2. 大数据学习——Linux-SSH报错:Could not resolve hostname centos02: Temporary failure in name resolution

    https://blog.csdn.net/mcb520wf/article/details/83303792 随笔异常 ssh: Could not resolve hostname centos0 ...

  3. Temporary failure in name resolution

    公司搬家,在一台测试机上执行git clone,出现错误 ssh: Could not resolve hostname **: Temporary failure in name resolutio ...

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

  5. 阿里云SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

    如果是阿里云的服务器 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in ...

  6. 运行ntpdate报错:Temporary failure in name resolution

    一.问题报错: 忽然发现某台机器时间慢了些几分钟,之前没有搭建ntpd服务,目前都是使用的ntpdate加定时任务进行时间同步.直接执行ntpdate报错如下: # ntpdate cn.pool.n ...

  7. mycat启动报错UnknownHostException(Temporary failure in name resolution)解决方法

    重启命令 ./mycat restart 查看日志 cd logs tail -f wrapper.log 报错信息 INFO | jvm 2 | 2018/05/09 11:28:28 | Erro ...

  8. IP address could not be resolved: Name or service not known

    [root@test ~]# /usr/local/mysql/bin/mysqld2018-08-05T07:00:33.647509Z 0 [Warning] [MY-011070] [Serve ...

  9. Docker 内pip安装package报错: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'

    说来奇幻(对本菜来说, 经常遇到堪称奇幻的问题) 之前在docker里面各种安装都没问题, 也不知道什么引起的, 昨天晚上调试的时候卸载了一个包的版本,然后就安不上了. 宿主机安装依然各种流畅,唯独d ...

随机推荐

  1. FROM使用子查询

    FROM使用子查询    子查询结果充当一个临时表.    //子查询形成的临时表字段为NO,NAME,SAL   select no,name from(     select empno no,e ...

  2. LeetCode OJ 215. Kth Largest Element in an Array 堆排序求解

    题目链接:https://leetcode.com/problems/kth-largest-element-in-an-array/ 215. Kth Largest Element in an A ...

  3. 使用Powershell 的获取别的机器WMI类失败解决方法!

    有些时候须要连接多台机器去获取他们的类,可是有些时候我们发现计算机无法连接,这个时候怎么办呢? 请改动组策略中下面配置: 能够使用Gpmc.msc 进行以后.本地计算机策略--计算机配置--管理模板- ...

  4. dom 编程(html和xml)

    html dom与xml dom关系: 什么是 DOM? DOM 是 W3C(万维网联盟)的标准. DOM 定义了訪问 HTML 和 XML 文档的标准: "W3C 文档对象模型 (DOM) ...

  5. org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.7.0_7

    32为的androidstudio: build.gradle: dexOptions { javaMaxHeapSize "1g"}

  6. linux怎么开启telnet服务

    1>编辑telent的配置文件/etc/xinetd.d/telnet 如下: (设置disable = no,也就是开启telnet服务) service telnet { disable = ...

  7. [codeforces 1037D] Valid BFS? 解题报告(验证bfs序,思维题)

    题目链接:http://codeforces.com/problemset/problem/1037/D 题目大意: 给出一棵树,询问一个序列是否可能为这棵树从节点1开始遍历的bfs序 题解: 对于每 ...

  8. JavaScript中Math常用方法

    title: JavaScript中Math常用方法 toc: false date: 2018-10-13 12:19:31 Math.E --2.718281828459045,算数常量e Mat ...

  9. ECharts 在winform中使用(访问JS)

    ECharts 是百度的一个开源chart 数据统计库,采用html5 + js 编程方式. 有比较好的动态效果,功能很强大.能做出酷弦的效果. ECharts 一般用于web 开发.但winform ...

  10. 【原创】查询占CPU高的oracle进程

    1:首先使用TOP命令传到占用CPU高的SPID号 PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND3575 oracle 1 12 ...