今早发现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. 【codeforces 452D】Washer, Dryer, Folder

    [题目链接]:http://codeforces.com/problemset/problem/452/D [题意] 洗衣服有3个步骤,洗,干,叠; 有对应的3种洗衣机,分别有n1,n2,n3台,然后 ...

  2. 洛谷 P2111 考场奇遇

    P2111 考场奇遇 题目背景 本市的某神校里有一个学霸,他的名字叫小明(为了保护主人公的隐私,他的名字都用“小明”代替).在这次的期中考试中,小明同学走桃花运,在考场上认识了一位女生,她的名字叫小红 ...

  3. [using_microsoft_infopath_2010]Chapter1 介绍InfoPath2010

    本章提要 1.列举对于就SharePoint2010来说使用InfoPath2010的好处 2.使用Office后台函数创建InfoPath表单 3.使用InfoPath接口 4.创建基于XML的文件 ...

  4. linux svn命令具体解释

    检測是否安装svn:svnserve --version svn服务的关闭:killall svnserve 创建svn库:svnadmin create /opt/svn/repos 配置自己主动启 ...

  5. [HTML5] Inlining images with SVG and data URIs

    The main reason you want to do I"nlining images with SVG and data URIs" is to reduce http ...

  6. vue 路由demo

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. TortoiseGit连接github.com

    1.下载两个软件:msysgit,TortoiseGit 2.先安装msysgit,再安装TortoiseGit,安装过程保持默认即可. 3.为了安全,我们需要使ssh key.开始菜单--Torto ...

  8. sql server Delete误操作后如何恢复数据

    声明:本文是根据别人的经验https://blog.csdn.net/dba_huangzj/article/details/8491327写的总结 说明:update和delete时没有加where ...

  9. sql server 查询某数据库中包含某字段的所有表格

    场景:查询DNMes数据库中所有包含RFID字段的表名 sql语句: select object_name(id) objName,Name as colName from syscolumns wh ...

  10. 004.ES2015和ES2016新特性--块级作用域变量

    其基本原理就是JavaScript的作用域链,下面以对比的方式来展示一下函数级作用域和块级作用域. 函数级作用域 var fns = []; for (var i = 0; i < 5 ; i+ ...