帮助中心 >  技术知识库 >  数据库 >  数据库管理 >  Linux 初始化MySQL数据库报localhost.localdomain错误的解决办法

Linux 初始化MySQL数据库报localhost.localdomain错误的解决办法

2018-10-15 11:22:17 11766

Linux 初始化MySQL数据库报localhost.localdomain错误的解决办法


在Linux   CentOS 5 中安装完MySQL (server、devel)之后进行初始化


service mysqld  start ,执行命令报错:


Neither host 'localhost.localdomain' nor 'localhost' could be looked up with
 
/usr/bin/resolveip
 
Please configure the 'hostname' command to return a correct hostname.

错误: 

解决办法

查看/etc/hosts,内容如下:


# Do not remove the following line, or various programs
 
# that require network functionality will fail.
 
::1 localhost.localdomain localhost

将::1修改为127.0.0.1后,就能启动成功了。


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: