今天我升级mysql到5.1的时候遇到的。写出来共享以下。
1、
[root@localhost mysql]# scripts/mysql_install_db
neither host 'localhost.localdomain' nor 'localhost' could be looked up with
/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
这个主要是修改/etc/hosts文件
echo 127.0.0.1 localhost.localdomain localhost >> /etc/hosts
然后再初始化数据,如果还是同样的错误,那就直接加--force开关。
我今天碰到的就是这个情况。
[root@localhost mysql]# scripts/mysql_install_db --force
installing mysql system tables...
ok
filling help tables...
ok
to start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
please remember to set a password for the mysql root user !
to do so, start the server, then issue the following commands:
/usr/local/mysql//bin/mysqladmin -u root password 'new-password'
/usr/local/mysql//bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
see the manual for more instructions.
you can start the mysql daemon with:
cd . ; /usr/local/mysql//bin/mysqld_safe &
you can test the mysql daemon with mysql-test-run.pl