• Resolved jonokane

    (@jonokane)


    Hello All,
    First, I have done a ton of searching on this topic and I see that I’m not the only one having issues. Unfortunately, I have spent far too much time on this and I’m still scratching my head.

    I am using a fresh install of OS X Leopard, I have PHP 5.2.4 running, MySQL 5.0.51a MySQL Community Server running on top of OS X’s pre-installed Apache. I can parse PHP, and I can connect to my local MySQL server via command line. I installed phpMyAdmin, and that’s running smoothly locally as well (phpMyAdmin is able to connect read/write to/from MySQL).

    I keep getting the “Error establishing a database connection” page when I hit my local wp site. I have a fresh install of WordPress, with a double-triple-checked wp-config.php file. Configured as follows:

    define('DB_NAME', 'dbname');    // The name of the database
    define('DB_USER', 'root@localhost');     // Your MySQL username
    define('DB_PASSWORD', 'xxx'); // ...and password
    define('DB_HOST', 'localhost');    // 99% chance you won't need to change this valu

    e

    I tried changing the ‘DB_HOST’ designation to my machine’s IP, this did not work as well.

    I have also re-assigned the mysql.default_socket php.ini:
    mysql.default_socket = /tmp/mysql.sock

    Additionally, the my.cnf file:

    [mysqld]
    socket=/var/mysql/mysql.soc

    I have tried restarting all services, re-installing all services (besides apache), and, well, I’m starting to lose hope! I have done wp installs a gazillion times, but never ever had an issue like this!!!! Someone please help! Any smart suggestions are greatly appreciated!

Viewing 6 replies - 16 through 21 (of 21 total)
  • Oh man, that’s so easy, and yet it would have taken me days to figure that out.

    Thanks!

    this is good article l have a need document about this article.

    Might be a good thing to add to the comments in wp-config-sample.php, no? Not sure if it’s a bug or a feature but it would save people some time if they knew how to avoid getting stuck in it.

    Thanks jonokane!!!

    I’ve just installed MySQL and wordpress using Xampp and had a similar problem with it. Changing the name of localhost to Localhost fixed it. Using Xampp works great – seconds to set up and if you correct the config.inc.php wp-config.php as above it should just take you about 5 mins to get a working local wordpress. ??

    Thanks so much jonokane. I’ve spend 2 1/2 hours on this…damn stupid.
    Cheers

    funkyjim

    (@funkyjim)

    Thanks for publishing your fix. This has saved me a great deal of (more) time. Props to you.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Error establishing a database connection on OS X 10.5’ is closed to new replies.