当前位置:Gxlcms > mysql > Linux下安装MySQL步骤_MySQL

Linux下安装MySQL步骤_MySQL

时间:2021-07-01 10:21:17 帮助过:14人阅读

bitsCN.com

1.下载安装包(这里是32位的):

MySQL-client-5.6.13-1.rhel5.i386.rpm

MySQL-server-5.6.13-1.rhel5.i386.rpm

2.安装

rpm -ivh MySQL-server-5.6.13-1.rhel5.i386rpm -ivh MySQL-client-5.6.13-1.rhel5.i386

3.重启

4.netstate -ntl 查看3306端口是否启动,启动则正常。

5.

mysqladmin -u root password '123456';mysql -u root -p123456

如果进入,即出现mysql>表示安装登陆成功!

但是我第五步总会出错,错误信息是

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解决办法是:

 /etc/init.d/mysql stopmysqld_safe --user=mysql --skip-grant-tables --skip-networking &mysql -u root mysqlmysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';mysql> FLUSH PRIVILEGES;mysql> quit /etc/init.d/mysql restartmysql -u root -pnewpassword

 

bitsCN.com

人气教程排行