MySQL Forums
Forum List  »  Install & Repo

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Posted by: zhu ye ye
Date: November 22, 2013 12:31PM

I am new to mysql , recently I installed MySQL 5.6.14 on my RHEL5.9 x64 in my vmware workstation.But when I did some exchange to the default database which is 'mysql',something bad happened to me.When I did FLUSH PRIVILEGES on mysql command line,I could never find 'mysql' database.only 'test'could be seen.
Later I find how to find the database again.It might caused by the changes to the 'user' table in 'mysql' database.So ,I do the following and I hope this can you.
1.stop mysql service with "service mysqld stop"
2.start mysql service with "/usr/local/mysql/bin/mysqld_safe --skip-grant-tables & "
3.Login mysql with "mysql -u root -p"
4.These are finished in mysql command line:
>USE mysql;
>UPDATA user SET Password=PASSWORD('newpassword') where USER='root';
>FLUSH PEIVILEGES;
>quit
5.reatart mysql service with "service mysqld restart"

Now you can login successfully via using "mysql -u root -p",and you can find the database you want!

Options: ReplyQuote


Subject
Written By
Posted
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
November 22, 2013 12:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.