Thursday, June 5, 2008

MySql 5: Error No. 1045 Access denied for user 'root'@'localhost' (using password: NO)

MySql 5: Error No. 1045 Access denied for user 'root'@'localhost' (using password: NO)

The above error happens in most cases when you have not given any password for ROOT user.

Solution:-

go to the bin directory of mysql and type the below.

c:\> mysqladmin SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

or try allowing the 3306 port in your client firewall

or check if some other application is using the 3306 port by "netstat" command.


---------------------------------------------
If instead of NO , you get a YES

The “YES” doesn’t mean that you are using the password “Yes” it simply mean “Yes” you are using a password. If the password was blank it might say “No”

The problem is the host shouldn’t be ‘%’.
Set it to ‘localhost’. Problem solved.
update user set Host=’localhost’ where User=’myUserName’

No comments:

Post a Comment