在做MySQL初始化时,如果机器的名不能进行反解会出现以下错误:
1 2 3 4 5 6 | WARNING: The host 'node2' could not be looked up with 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 ! |
1 | #/usr/local/mysql/bin/resolveip node2 |
/usr/local/mysql/bin/resolveip: Unable to find hostid for ‘node2′: host not found
处理过程如下
1. 查看机器的名
1 | #hostanme |
node2
2. 查看/etc/hosts文件
1 | #cat /etc/hosts |
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
可见/etc/hosts中无相应的机器名
添ip(本机的ip) 到机器的对应到/etc/hosts中:
最终/etc/hosts内容如下:
1 2 | 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 10.10.60.148 node2 |
3.使用resolveip确认是否ok
1 | #/usr/local/mysql/bin/resolveip node2 |
IP address of node2 is 10.10.60.148
4. 在次运行初始化程序
1 2 | cd /usr/local/mysql ./script/mysql_db_install |
Good luck!
觉得文章有用?立即:
和朋友一起 共学习 共进步!