ITPub博客

首页 > 数据库 > MySQL > mysql初始化主机名无法解析

mysql初始化主机名无法解析

原创 MySQL 作者:wzq609 时间:2015-06-26 15:51:42 0 删除 编辑

说明:安装完成数据库5.6.23,进行初始化的时候报主机名无法解析的错误,详细如下

[root@DB01 mysql-5.6.23]# WARNING: The host 'DB01' could not be looked up with /usr/local/mysql/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !

 

手工进行反向解析:

root@DB01 mysql-5.6.23]# /usr/local/mysql/bin/resolveip DB01
/usr/local/mysql/bin/resolveip: Unable to find hostid for 'DB01': try again

 

解决方法:修改/etc/my.cnf文件
[root@DB01 mysql-5.6.23]# vi /etc/my.cnf

[root@DB01 mysql-5.6.23]# cat /etc/hosts

[root@OMS_DB01 bin]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.9  DB01

 

测试:
[root@DB01 mysql-5.6.23]#  /usr/local/mysql/bin/resolveip  DB01
IP address of  DB01 is 192.168.0.9

 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

本文作者:JOHN,某上市公司DBA,业余时间专注于数据库的技术管理,从管理的角度去运用技术。

技术博客:猎人笔记                                                数据库技术群:367875324 (请备注数据库类型)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12679300/viewspace-1713243/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-06-16

  • 博文量
    173
  • 访问量
    2894284