Support » Localhost Installs » wp-config.php not working with MySQL

  • Resolved 100PercentNick


    Hi guys, I’m trying to get a wordpress local install working on my Mac.

    I’ve recently set up a database, username and password using the MySQL client as per the instructions in the wordpress codex. That part is ok.

    When I go to the local site on my computer I’m prompted by wordpress to set up the wp-config.php file. Putting in the same details that definitely work with the MySQL client returns an error.

    Manually updating these details in the ‘wp-config-sample.php’ file and renaming it as ‘wp-config.php’ also doesn’t work – I’m now greeted with a big bold message: “Error establishing a database connection”.

    From what I can gather, php and mysql are not communicating with each other properly.

    I’ve changed the apache 2 configuration file found in ‘etc/apache2/httpd.conf’ and uncommented the line which loads the php5 module: LoadModule php5_module libexec/apache2/

    and restarted the apache server. This has still not fixed my problem. I’m stuck on what to do next… help appreciated please!

Viewing 1 replies (of 1 total)
  • Fixed it.

    I needed to put a ‘phpinfo.php’ file containing some php code into the localhost directory

    <?php phpinfo(); ?>

    After doing that, I could see it wasn’t configured and that I needed to change my php.ini file to get MySQL and PHP talking to each other.

Viewing 1 replies (of 1 total)
  • The topic ‘wp-config.php not working with MySQL’ is closed to new replies.