MySQL Forums
Forum List  »  PHP

Re: Access denied for user 'root'@'localhost' (using password: YES)
Posted by: chris stefanich
Date: July 30, 2008 07:58AM

I am having this same error.
I can connect to MySQL at the command line with the user and password, but when I try to connect with PHP (with the correct user and password):

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'qed_cstef'@'localhost' (using password: YES)

This is the line:
mysql_connect("localhost","qed_cstef","cstef") or die(mysql_error());

the user qed_cstef has all privileges and privileges have been flushed. The username and password work to log in at the command line.

This happens if any user has a password. If the user has no password, it works. I have scoured the internet, and can not find an answer to this.

Any help would be greatly appreciated.

Options: ReplyQuote




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.