I am trying to connect to a database, but it I am getting denied. The error message I get is:
Connect Error (1045) Access denied for user ‘root’@‘localhost’ (using password: NO)
The code I am using to connect is:
$db = new mysqli($config["mysql"]["host"], $config["mysql"]["username"], $config["mysql"]["password"], $config["mysql"]["database"]);
The values for for the $config array are (password changed for security reasons):
$config["mysql"]["username"] = "steam";
$config["mysql"]["password"] = "dummy_value";
$config["mysql"]["database"] = "steam";
$config["mysql"]["host"] = "localhost";
I don’t understand why it’s trying to use ‘root’ as I have specified a specific user. It also says ‘using password: NO’, why?
I have double checked the database itself - it’s there as I can access it in phpMyAdmin