MySQL Forums
Forum List  »  Install & Repo

Re: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Posted by: sandeep b
Date: September 15, 2009 04:08AM

hey guys i have the solution for the problem error 1045 (28000):access denied for the user 'root'@'localhost'(using password:NO)

step 1: query the user table of mysql database by logging in without password

\mysql -uroot
mysql>use mysql;

mysql>select user,host,password from user;

if the result set contains >2 users with the same name root then remove them by querying

mysql >delete from mysql.user where user='root';
(you can do this even for one root user)

step 2: add the root user like the below

insert into user(user,host,ssl_cipher,x509_issuer,x509_subject) values ('root','localhost','n','n','n');

step 3: now change the pass word of newly born user like

mysql>update mysql.user set password=password('root') where user='root';

now if u try to connect as

mysql -uroot -proot

the same problem arises

error 1045 (28000):access denied for the user 'root'@'localhost'(using password:NO)

step 4: now by giving a magic command you can resolve the problem

/mysql -uroot

mysql>flush privileges;
mysql>exit

step 5:now u can connect with mysql

/mysql -uroot -proot

thats all folks........................:)

Options: ReplyQuote


Subject
Written By
Posted
June 27, 2009 08:29PM
December 16, 2007 02:18AM
December 27, 2007 02:08PM
January 16, 2011 06:51AM
August 27, 2009 12:22AM
Re: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
September 15, 2009 04:08AM


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.