• I’ve tried both using the wordpress “dynamic” approach using the web interface and configured this file manually but with zero success. I’m using WordPress 2.6.3 but have been able to use earlier versions of WordPress 2.6 with no problems in the past. This is a fresh install (I formatted my system).

    I have a root user for ‘127.0.0.1’, ‘localhost’, and ‘rhino.local’ (my Leopard OS domain). After connecting to mysql (mysql -u root), I set the password for all of these accounts to be ‘abc’ using:

    %> SET PASSWORD ‘root’@’127.0.0.1’ = NEW PASSWORD(‘abc’);
    %> SET PASSWORD ‘root’@’localhost’ = NEW PASSWORD(‘abc’);
    %> SET PASSWORD ‘root’@’rhino.local’ = NEW PASSWORD(‘abc’);

    From this machine using the command line I’m now able to connect with my new password like so:

    mysql -u root -p

    I provide my credentials using the “suggested method” as illustrated in this image and have tried substituting ‘rhino.local’ with ‘127.0.0.1’ and ‘localhost’ without success as well. I obviously want to try it using my Domain as it makes your site more “public” (I realize this is only visible on my LAN but it’s good practice for my purposes).

    I’m using Apache with the rewrite module enabled (libexec/apache2/mod_rewrite.so) found in my httpd.conf file, MySQL 5.0 (package format) installed to /usr/local/mysql and PHP 5.2.6.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Shmaff

    (@shmaff)

    Sorry. Here’s the missing link to the aforementioned image.

    Try this one:

    SET PASSWORD ‘root’ = NEW PASSWORD(‘abc’);

    BTW, It’s generally a very bad idea to use the root account for this kind of thing. Create an account just for the wordpress database.

    Thread Starter Shmaff

    (@shmaff)

    Thanks, Ogre. I will, but for the meantime I just want to get one user, “God”, to work. I’m just focussed on my Intranet for now where I’m not too concerned with security.

    Thread Starter Shmaff

    (@shmaff)

    This is a bump! However, I will bring you up to speed.

    I’ve created a new user with permissions equivalent to group. In this case, ‘alex’@’localhost’ since I’m testing on my local machine. I can create databases fine through the command line. Why do I get an error saying “Error establishing a database connection” when I give it these same credentials?

    i.e.
    User: ‘alex’
    Pass: ‘abc123’
    Host: ‘localhost’
    database: ‘wordpress’

    Thread Starter Shmaff

    (@shmaff)

    I’ve come back to working on this problem (alone, seemingly) and have done some more digging…

    I’ve chased the problem down to the class ‘wpdp’ found in the wp-includes/wp-dp.php file. This class has a constructor method wpdp, coincidentally *wink*, and calls the ‘__construct’ method (line #306). Finally, somehow, the connection to the mysql database fails on line #318. I tried to define the WP_DEBUG constant as such:

    define(‘WP_DEBUG’, ‘WP_DEBUG’, true);

    that failing, I also tried:

    define(‘WP_DEBUG’, true);

    Neither define statements worked. I’m no php pro. Actually, this is the first time I’ve even traced php… but have a background in OOP so I’m not that much of a n00b at this sort of thing!

    Can anyone else help me in this trace?

    Software as tested:

    From command line:
    rhino:~ alex$ mysql –version
    mysql Ver 14.12 Distrib 5.0.67, for apple-darwin9.0.0b5 (i686) using readline 5.1

    rhino:~ alex$ php –version
    PHP 5.2.6 (cli) (built: Jul 17 2008 23:04:49)
    Copyright (c) 1997-2008 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

    Macintosh OSX Leopard 10.5.5 Build 9F33

    You get the error establishing databases because you have the host defined as “localhost”, not “Localhost”. For some reason OSX only recognizes it with the capital “L”. Do it with the capital “Localhost” and you won’t get that database connection error.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can’t connect to database during creation of wp-config.php’ is closed to new replies.