Linux下安装MySQL步骤

 

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.i386

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

 

3.重启

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

5.

mysqladmin -u root password '123456';

mysql -u root -p
123456

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

 

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

 

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

 

解决办法是:

 /etc/init.d/mysql stop

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

mysql -u root mysql

mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

 /etc/init.d/mysql restart

mysql -u root -p
newpassword

 

 

 

 

 

 

posted @ 2013-12-12 08:39  _Cafebabe  阅读(234)  评论(0编辑  收藏  举报