0

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.

Rahul Bharadwaj
  • 2,555
  • 2
  • 18
  • 29
  • When you say does not reflect can you clarify ? – Shyam Joshi Jun 10 '18 at 13:33
  • I have added necessary explanations, any ideas? – Rahul Bharadwaj Jun 10 '18 at 13:37
  • Do you have phpmyadmin?? – Dev Man Jun 10 '18 at 13:38
  • Yes, I have phpmyadmin and I am able to access it. Although the `user` table inside `mysql` database has the password field named as `password` whereas the same field was named as `authentication_string` when I was changing the root password. – Rahul Bharadwaj Jun 10 '18 at 13:42
  • I know it's a silly question, but are you 100% definitely accessing the same server in both cases? – MandyShaw Jun 10 '18 at 18:01
  • And, otherwise, are you using any sort of cached/pooled setup that might prevent the change from being picked up? I would try restarting the MySQL server, unless it's being used for anything else of course. – MandyShaw Jun 10 '18 at 18:11
  • Okay, I'll see what's causing the problem. Even I'm not sure that it's running the same server on both sides. I'll try uninstalling MySQL and XAMPP and then verify. – Rahul Bharadwaj Jun 11 '18 at 03:39

0 Answers0