Jump to content
Larry Ullman's Book Forums

Could Not Connect To Mysql: Access Denied For User 'username'@'localhost' (Using Password: Yes)


Recommended Posts

Hi, 

 

I was working on the example "Message Board" on chapter 17, but I can't connect to the database. I am getting the following error "Could not connect to MySQL: Access denied for user 'username'@'localhost' (using password: YES)"  I am using XAMPP. Any help will be appreciated. 

 

   

Link to comment
Share on other sites

  • 1 month later...

Obviously, I am a novice at this. I created a password for the root user and added another user "Rick" with a password. I changed the host in the config file from 127.0.0.1 to localhost. I saved the file s mysqli_test.php with the exact text in the example since I am not sure what needs to be changed.

 

<?php
mysqli_connect ('localhost', 
'webuser', 'BroWsIng', 'temp');
?>
 

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'webuser'@'localhost' (using password: YES) in C:\xampp\htdocs\mysqli_test.php on line 3

Link to comment
Share on other sites

 Share

×
×
  • Create New...