VPS侦探论坛

 找回密码
 注册
查看: 4425|回复: 1

mysql 启动不了

[复制链接]
发表于 2015-8-21 02:03:57 | 显示全部楼层 |阅读模式

contOS6.5 安装的系统是 Red hat(64 bit)Linux version 2.6.32-431.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) )

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-8-21 08:45:18 | 显示全部楼层


安装mysql数据库时报错:
Neither host 'localhost.localdomain' nor 'localhost' could be looked up with
/usr/local/mysql/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option

按提示应该是hosts里没有localhost,你可以看一下/etc/hosts是否有127.0.0.1 localhost.localdomain localhost
没有的话执行:echo "127.0.0.1 localhost.localdomain localhost" >> /etc/hosts
然后重启
卸载lnmp,再重新安装,不重新安装也行,在mysql源码目录里执行:
  1. /usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --force
  2. chown -R mysql /usr/local/mysql/var
  3. chgrp -R mysql /usr/local/mysql/.
  4. \cp support-files/mysql.server /etc/init.d/mysql
  5. chmod 755 /etc/init.d/mysql
复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 02:36 , Processed in 0.025863 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表