大数据

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

时间:2014-9-30 17:52:58  作者:说歌社区  来源:www.solgle.com  查看:629  评论:0
内容摘要:When I install mysql database in linux server,I can't login in and print the error 28000[root@mysqlsrv soft]# mysql -u root -pEnter password...

When I install mysql database in linux server,I can't login in and print the error 28000...
The content come from: http://www.solgle.com/news/141.html
 

[root@mysqlsrv soft]# mysql -u root -p

Enter password:

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


The method :
 

1:update system config file /usr/my.cnf

[root@mysqlsrv soft]# vi /usr/my.cnf

……

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

###add next item only###

skip-grant-tables

 

wq!

[root@mysqlsrv soft]#

 

2:restart mysql service

[root@mysqlsrv soft]# service mysql restart

Shutting down MySQL...                                     [ç¡®å®]

^[[?1;2cStarting MySQL................                     [ç¡®å®]

 

3:Reset password again

[root@mysqlsrv ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.6.20-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

 

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql> set password=password('111111');    

Query OK, 0 rows affected (0.02 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)
 

mysql> quit

 

Bye

 


4:Recover our set

[root@mysqlsrv soft]# vi /usr/my.cnf

……

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

###delete next item only###

##skip-grant-tables

wq!



5:Restart mysql server again

[root@mysqlsrv soft]# service mysql restart

Shutting down MySQL...                                     [ç¡®å®]

 

^[[?1;2cStarting MySQL................                     [ç¡®å®]

6:Then,you can login in using your password.


About all install steps,you can view page http://www.solgle.com/news/?142.html

 

标签:ERROR 1045 (28000) Access denied for user root@localhost 

solgle.com 版权所有,欢迎分享!!!

相关评论
   Copyright © 2013-2020 solgle.com,All rights reserved.[solgle.com] 公安机关备案号:51010802000219
Email:solgle@solgle.com; weixin:cd1008610000 ICP:蜀ICP备14011070号-1