Error:Access denied for user 'root'@'localhost'

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Error:Access denied for user 'root'@'localhost'

Post by eshban »

I am trying to apply password on MYSQL, dont know what happens.

now when i open
http://localhost/phpmyadmin
i got the following error.


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

plz guide that how to remove the pasword
and how to apply new password to mysql

thanks
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You are going to need to get into mysql as root. I would imagine that you would have to use the command line if PMA is not working for you. Of course, the obvious question to start with is which PHP version are you using, which MySQL version are you using and what is your current MySQL Client API version?
chakhar86
Forum Commoner
Posts: 45
Joined: Mon Jun 05, 2006 1:36 am
Contact:

Re: Error:Access denied for user 'root'@'localhost'

Post by chakhar86 »

eshban wrote:I am trying to apply password on MYSQL, dont know what happens.

now when i open
http://localhost/phpmyadmin
i got the following error.


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

plz guide that how to remove the pasword
and how to apply new password to mysql

thanks
Usually you just have to change it in 'mysql.ini' file.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

There are no passwords in my.conf. The root user is actually stored in the user table of the mysql database. This sounds like a client api issue.
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Post by amir »

-> come to this page http://localhost/phpmyadmin/
-> u will c here a link Privileges
-> click it now , here u can add a new user and also change the password of old user.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

If he can't log in as root then he won't be able to add users unless the login that he uses has global permissions.
cinac
Forum Newbie
Posts: 9
Joined: Wed Nov 16, 2005 1:30 pm

Post by cinac »

If you set a user password, you need to reload MySQL so it will reread the info. Just do a "flush privileges;" command at the command line.

If you can't get into the command line tool since you don't know the password, stopping and restarting the MySQL process will have the same effect as the flush privileges; then the new password should be in effect.

If you've totally forgotten the password or something, you can start MySQL with the --skip-grant-tables switch, set the password, then stop/restart MySQL normally.

See http://dev.mysql.com/doc/refman/5.0/en/ ... sions.html for more info
Post Reply