MySQL Forums
Forum List  »  PHP

Re: Error : (1045) Access denied for user 'root'@'localhost' (using password: NO)
Posted by: Peter Brawley
Date: March 15, 2017 12:22PM

Basic PHP debugging: stub out the problem values, have your script echo the values of $localhost, $username, $password, $database, and compare with the results of this query in the mysql client ...

select user, host, authentication_string from mysql.user;

... or if the MySQL version < 5.7 ...

select user, host, password from mysql.user;

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.