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