当前位置: 首页 > news >正文

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



相关文章:

  • java基础系列:(一)初始化与清理
  • tarjan强联通分量(模板)
  • 4.3.4 空值与聚合函数
  • AC日记——矩阵取数游戏 洛谷 P1005
  • 【Docker镜像】docker默认存放路径
  • iOS多线程---NSOperation的常用操作
  • Spring源码-IOC容器(六)-bean的循环依赖
  • Android 图片缓存处理
  • iOS中 OC字符串 与 C语言字符串 相互转换
  • php+Ajax 例子
  • 英语句型——口语
  • 三重积分计算--切片法
  • 关于梦想
  • 不用軟體解PPT密碼
  • 元组
  • 【跃迁之路】【735天】程序员高效学习方法论探索系列(实验阶段492-2019.2.25)...
  • C++类中的特殊成员函数
  • echarts花样作死的坑
  • extract-text-webpack-plugin用法
  • Git同步原始仓库到Fork仓库中
  • mockjs让前端开发独立于后端
  • PHP 7 修改了什么呢 -- 2
  • python学习笔记-类对象的信息
  • SQLServer插入数据
  • tensorflow学习笔记3——MNIST应用篇
  • 不发不行!Netty集成文字图片聊天室外加TCP/IP软硬件通信
  • 跨域
  • 利用阿里云 OSS 搭建私有 Docker 仓库
  • 漫谈开发设计中的一些“原则”及“设计哲学”
  • 七牛云 DV OV EV SSL 证书上线,限时折扣低至 6.75 折!
  • 前端之React实战:创建跨平台的项目架构
  • 视频flv转mp4最快的几种方法(就是不用格式工厂)
  • 微服务入门【系列视频课程】
  • 微信小程序填坑清单
  • 为什么要用IPython/Jupyter?
  • 小而合理的前端理论:rscss和rsjs
  • 异常机制详解
  • 字符串匹配基础上
  • ​TypeScript都不会用,也敢说会前端?
  • ​比特币大跌的 2 个原因
  • $.ajax,axios,fetch三种ajax请求的区别
  • (8)Linux使用C语言读取proc/stat等cpu使用数据
  • (附源码)ssm基于jsp的在线点餐系统 毕业设计 111016
  • (免费领源码)Java#Springboot#mysql农产品销售管理系统47627-计算机毕业设计项目选题推荐
  • (强烈推荐)移动端音视频从零到上手(上)
  • (三)c52学习之旅-点亮LED灯
  • (三)终结任务
  • (三分钟了解debug)SLAM研究方向-Debug总结
  • (十)T检验-第一部分
  • (学习日记)2024.03.25:UCOSIII第二十二节:系统启动流程详解
  • (一) springboot详细介绍
  • (转) 深度模型优化性能 调参
  • .NET Compact Framework 3.5 支持 WCF 的子集
  • .Net core 6.0 升8.0
  • .NET CORE Aws S3 使用