mysql初始化主機名無法解析

wzq609發表於2015-06-26

說明:安裝完成資料庫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 !

 

手工進行反向解析:

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章