首页 > 代码库 > WARNING: The host '$hostname' could not be looked up with resolveip. (转)

WARNING: The host '$hostname' could not be looked up with resolveip. (转)

环境介绍:CentOS6.X
MySQL版本:5.5.X以上
执行scripts/mysql_install_db脚本时,抛出一条Warning,主机名和IP地址无法解析;
技术分享

The host ‘$hostname‘ could not be looked up with resolveip.
随即仔细检查了这个脚本文件
在327行至351行发现了这个告警信息的代码;

技术分享
解决办法:
把主机名和IP对应关系写入/etc/hosts里面即可
#echo "172.27.1.78 mysql78" >> /etc/hosts
单独调用330行命令测试
# ./bin/resolveip mysql78
IP address of mysql78 is 172.27.1.78
至此这个问题就解决,如果不放心,可再次执行这个脚本做验证

WARNING: The host '$hostname' could not be looked up with resolveip. (转)