I changed the root password for MySQL as shown in this answer.
But my understanding is that this would change the root password when accessing the same MySQL from PHP.
Earlier the root password was an empty string (""
) in PHP MySQL, as in doing this would work:
$dbConn = new mysqli("localhost","root","");
But even after changing the root password as in the answer above, it doesn't reflect in PHP MySQL.
As in, if I changed the root
password to X
.Then while using mysqli_connect()
method, if I do:
$dbConn = new mysqli("localhost","root","X");
It says Access denied for user 'root'@'localhost'
BUT, if I continue the old way, it suceeds.
Am I missing something here? Is there something wrong that I have done?
I can provide any extra details if needed.