Page is a not externally linkable
- WebmasterWorld
-- The Macintosh Webmaster
---- MySQL Login Via PHP - Won't Accept Same Login As phpMyAdmin


JTeagle - 4:03 pm on Sep 13, 2012 (gmt 0)


I'm pretty much a Mac newbie (and not exactly comfortable with MySQL administration), so be gentle with me.

I've got what I believe is a pretty standard installation of MySQL running on my MacBook, and the MySQL database has some tables and users. In and of itself, I know this is working (see below).

I have my main machine, which is Windows, and I'm trying to develop PHP by using the Mac as my server.

If I run up phpMyAdmin (whose files are located on the Mac) and log in using root and the password I set, it works; I get access and I can administer the databases.

If I try and connect in using PHP's mysql_connect (via the client machine's web browser), using the same credentials and either localhost:3306 or 127.0.0.1:3306, it refuses, saying 'Access denied for user 'root'@'localhost' (no, I'm *not* accidentally passing the single quotes in!).

Just for the sake of it, I tried the same PHP page directly on the Mac... and it failed in exactly the same way. The same Mac that lets me in with phpMyAdmin!

Am I missing something? Any help would be appreciated.

More:
* phpinfo() reports that mysql.default_socket is set to /tmp/mysql.sock - I can confirm that that file does indeed exist on the Mac and the info panel says everyone has read / write access to it. It also confirms that MySQL support is enabled.


Thread source:: http://www.webmasterworld.com/macintosh_webmaster/4494781.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com