0

I have to make a website where I have access to MySQL database 'forums' through PHP. I tried to do this by using XAMPP 3.3.0.

I can connect to MariaDB (I don't know what this is, though) by the statement:

mysql -u root -p -h localhost          //Strangely, I can log in with or without password.

However, when I use a statement like this in PHP file

$mysqli = mysqli_connect("localhost", "root", "admin", "forums");

My web page will return: Access denied for user 'root'@'localhost' (using password: YES). I have granted all the privileges to the user, and I am using the correct password.

Please let me know if you have any additional questions.

Jack
  • 9
  • 2
  • 1
    Does this answer your question? [Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?](https://stackoverflow.com/questions/17975120/access-denied-for-user-rootlocalhost-using-password-yes-no-privileges) – B001ᛦ Jun 26 '21 at 21:55

0 Answers0