
今天我升级到5.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
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…
Filling help tables…
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
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at
这样就成功初始化数据了。
如何解决MySQLAdministrator 启动报错
解决办法如下:C:/mysql-5.1.41-win32/bin>mysqld --install MySQL --defaults-file=c:/ successfully installed.C:/mysql-5.1.41-win32/bin>net start MySQLMySQL 服务正在启动 服务已经启动成功。 C:/mysql-5.1.41-win32/bin>1、通过执行mysqld --install命令可以安装MySQL服务,同时指定配置文件的位置2、通过执行net start 命令,启动MySQL服务这时你再运行MySQLAdministrator时,就不会再报错了。 参考资料mysqld --verbose --help 查看帮助删除MySQL服务C:/mysql-5.1.41-win32/bin>mysqld --remove MySQL停止MySQL服务net stop MySQL参考:
启动mysql时,提示错误,请高手解决。
这个应该是需要root权限,执行下sudo /etc/init.d/mysql restart试试
连接mysql提示net work error?
net work error错误是指网络错误,或者是端口错误。 可以从以下几个方面去排查1. 检查你连接mysql的ip正确,如果正确在ping一下,如果ping不同,则说明网络不通,检查你的网段是否一致。 2. 如果能ping通,检查MySQL安装机器的防火墙(windows)或者端口是否开放(linux)。 这时候可以在mysql服务器上直接链接mysql试一下。 3. 如果mysql服务器上能连接成功,并且防火墙,端口都开放,在检查下账户名或者密码,不够这种情况一般都不会报network error,报的都是access denied这样的错误
发表评论