煮酒听雨
首页
PHP
MYSQL
WEB
Linux
关于本站
登陆
注册
MySQL错误日志 [Warning] IP address 'XX.XX.XX.XX' could not be resolved: Name or service not known 解决
编辑时间:2018-06-10
编辑:忘尘
阅读:1097
##### 查看mysql错误日志目录 注意:默认情况下,所有日志创建于mysqld数据目录中,其中错误日志为 hostname.err ```linux mysql> show variables like 'log_error'; +---------------+--------------------------------+ | Variable_name | Value | +---------------+--------------------------------+ | log_error | /var/log/mysql/mysql-error.log | +---------------+--------------------------------+ 1 row in set (0.00 sec) ``` 在数据库的错误日志log中,会出现下面的警告: ```linux 190517 9:09:37 [Warning] IP address '47.95.28.143' could not be resolved: Name or service not known 190517 12:37:56 [Warning] IP address '47.52.221.59' could not be resolved: Name or service not known 190517 16:42:23 [Warning] IP address '119.23.138.247' could not be resolved: Name or service not known 190518 0:31:38 [Warning] IP address '47.97.16.76' could not be resolved: Name or service not known 190518 8:21:46 [Warning] IP address '47.100.64.9' could not be resolved: Name or service not known 190518 8:30:58 [Warning] IP address '47.100.64.86' could not be resolved: Name or service not known 190518 19:52:26 [Warning] IP address '61.140.237.118' could not be resolved: Name or service not known 190519 0:37:19 [Warning] IP address '106.15.52.246' could not be resolved: Name or service not known 190519 5:02:51 [Warning] IP address '47.94.52.159' could not be resolved: Name or service not known 190519 8:18:03 [Warning] IP address '106.14.104.214' could not be resolved: Name or service not known 190519 8:44:39 [Warning] IP address '47.96.254.10' could not be resolved: Name or service not known 190520 1:42:48 [Warning] IP address '120.78.225.124' could not be resolved: Name or service not known 190520 8:22:13 [Warning] IP address '118.31.244.58' could not be resolved: Name or service not known 190520 8:59:37 [Warning] IP address '47.100.130.114' could not be resolved: Name or service not known ``` ##### 警告产生的原因: 出现错误的原因是MYSQL Server在本地内存中维护了一个非本地的Client TCP cache,这个cache中包含了远程Client的登录信息,比如IP地址,hostname等信息。 如果Client连接到服务器后,Mysql首先会在本地TCP池中根据IP地址解析客户端的hostname或者反解析,如果解析不到,就会去DNS中进行解析,如果还是解析失败,就是在errorlog中写入这样的警告信息。 ##### 解决的办法 在mysql的配置文件my.cnf [mysqld]项中增加一项 skip-name-resolve 后重启mysql服务 (该参数的作用:不再进行反解析(ip不反解成域名),这样也可以加快数据库的反应时间) ```linux [mysqld] skip-name-resolve ``` DNS解析是指,将 域名解析成ip地址; DNS反解析是指,将IP地址反解析成域名;
来说两句吧
提交评论
最新评论
我的标签
函数
面试
REDIS
LNMP
验证
时间
JS
LINUX
CPA
常量
MYSQL
备份
微信
文件
压缩
优化
SVN
PHP
集合
数组
HTML
收藏
NGINX
配置
日志
性能
加密
下载
FORM
WEB
样式
SQL
表单
配置,面试,REDIS
编码
ARRAY
替换
截取
密码
版本
进程
定时
测试
事务
数据
权限
安全
防火墙
索引
设计模式
安全,面试
缓存
热文排行
LNMP状态管理命令
navicat for mysql 导入xlsx,
(置顶)开发中常用功能知识点笔记
(置顶)收藏优秀分享文章集合
PHP加密解密算法(Discuz!经典代码)
PHP 获取数组第一个元素或最后一个值
Nginx配置 nginx.conf 文件中常用配
MySQL错误日志 [Warning] IP ad
Redis持久化:快照(RDB)和AOF简解
浅析SQLmap
随机文章
友情链接
官方手册
thinkphp
php扩展
Linux命令
lnmp
PHP中文网
鸟哥Linux私房
Nginx中文文档
json格式化
Redis手册
composer中文文档
CentOS下载
流程图
VPN代理
菜鸟网
奇淼教程
首页
PHP
MYSQL
WEB
Linux
关于本站
登陆
注册