MySQL Access Denied on OSX 10.6.6
Man, this drove me nuts. I have a native setup of MySQL and PHP. I followed the detailed steps defined by Jerome here, but I kept getting:
Access denied for user 'root'@'localhost' (using password: YES)
So I could connect, but access was denied, and I was positive, 100% sure that the password was correct. So I tried creating another user. The code was pretty simple
<?php error_reporting(E_ALL); mysql_connect('localhost', 'jgerard', 'password') or die(mysql_error()); echo 'No errors'; ?>
I checked everything, and it was good. Then I tried not using localhost, or 127.0.0.1 and everything passed. No problem. The problem was using the wildcard in the mysql account setup. So this does **not** work:
But this does:
So basically, make sure you list localhost specifically for the user, and you’re set. Otherwise, you have to use the external IP address of the machine, and not the loopback.