mysql 启动不了
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) ) 安装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源码目录里执行:/usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --force
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/.
\cp support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
页:
[1]