• I am attempting to get a local copy of WordPress running on OS X. I have MySQL 5.0.34 running, and can connect to database wordpress with user wordpress using the local mysql client. I am running PHP 4.4 from Apache 1.3.33, which are the defaults on OS X.

    I have configured wp-config.php to point to localhost with the appropriate values for db name, user and password. I can see that the file is being picked up, as when I change the db host in the file, the value is reflected in the error message.

    When I try to go to localhost/wordpress/wp-admin/install.php, I get a message saying the database could not be reached. I have turned MySQL logging on, but do not see any connection attempt being made to MySQL–I do see connection information when connecting from the mysql client. I have also tried putting the MySQL port number (3306) into the db host (localhost:3306), with no affect, other than the changing error page.

    Any ideas how to trouble shoot this would be appreciated. I do not know how to get more information about how WordPress is trying to connect, or what settings I might try changing.

    Thanks for the help,

    Nathan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter corvinonathan

    (@corvinonathan)

    I found some pages that address this problem. OS X’s PHP and the default OS X MySQL install do not agree on the location for the MySQL socket. Changing either the PHP or MySQL notion of where the socket should be fixes the problems, and lets everything work fine. There is an OS X install page that mentions this that the WordPres documentation links to, but there are others that do not mention it.

    The MySQL socket location can be changed by creating /etc/my.cnf, and adding:

    `
    [mysqld]
    socket=/var/mysql/mysql.sock
    `

    Alternatively, the location PHP looks for the MySQL socket can be changed in /etc/php.ini, by editing the line:

    mysql.default_socket = /var/mysql/mysql.sock

    To:

    mysql.default_socket = /tmp/mysql.sock

    Relevant discussion can be found at:

    http://girtby.net/offerings/wordpress-osx-local-mirror http://docs.info.apple.com/article.html?artnum=302977

    Hope this helps others who encounter this problem in the future.

    Best,

    Nathan

    Having just worked through this on a friend’s machine, the problem we ran into is that the default Apache mysql/php modules apparently don’t like ‘localhost’ as the name for the local computer. When we changed the mysql host setting to ‘127.0.0.1’ it worked flawlessly.

    have you tried MAMP?

    thats wahat i have been using this entire year and it works GREAT!
    http://www.mamp.info/

    I discovered the following about OS X, WordPress Upgrade and PHP:

    – OS X does not recognize .htaccess (due to Unix). I found this out the hard way in Step 2 of http://codex.wordpress.org/Upgrading_WordPress_Extended. Hopefully a note for OS X can be added. The FTP software indicated the download was complete but the file was nowhere to be found. Essentially, our theme designer had to make a new .htaccess file to get the site back up.

    If you cannot reach myPHPadmin, switch to Safari, a PC, or ensure the Firefox popup window is not blocked.

    If you can’t find the tools for database administration, keep going deeper. The help page listing of tools on the home page is not always correct.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘MySQL Problem w/ OS X Installation’ is closed to new replies.