• Hello. I’m ashamed to admit that I’m also getting this error. I’ve looked over the support and docs and I see that this is a common issue, but I can’t figure it out. I’ve triple-checked that the username and password, database names and host name are correct. We’ve set priviledges for the user. We tried changing the password, but that didn’t work.

    I’m trying to set this up for a school, so I’m working with an IT guy and we both are unable to find the issue. They run Apache and RedHat server. My IT guy and I are both able to connect to the database using the command line with the username and password. I’m still getting the error trying to run the install.php.

    I’d appreciate any trouble-shooting ideas.

    Here’s my wp-config file:


    <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'degreecritical'); // The name of the database
    define('DB_USER', 'nyoung'); // Your MySQL username
    define('DB_PASSWORD', '*****'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!
    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-includes/languages.
    // For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');
    /* That's all, stop editing! Happy blogging. */
    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>

    and some of my database info:


    Connection id: 97
    Current database: degreecritical
    Current user: nyoung@localhost
    SSL: Not in use
    Current pager: stdout
    Using outfile: ''
    Using delimiter: ;
    Server version: 5.0.27-standard
    Protocol version: 10
    Connection: Localhost via UNIX socket
    Server characterset: latin1
    Db characterset: latin1
    Client characterset: latin1
    Conn. characterset: latin1
    UNIX socket: /tmp/mysql.sock
    Uptime: 24 days 5 hours 16 min 2 sec

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Maybe review the info here if you are using MySQL client:
    Installing_WordPress#Using_the_MySQL_Client

    Man, you are a stubborn guy. Since you should never display a pw in public, I edited it out once… but you keep putting it back ??

    Thread Starter satyanaas

    (@satyanaas)

    Hi, Sorry I was re-editing my post. I didnt’ mean to put the password in there! Thank you.

    Thread Starter satyanaas

    (@satyanaas)

    Thanks, MichaelH. Yes, I did follow those commands. Could it be something else with my database (the database name?) that I should look for that could be preventing the wp-config.php file from connecting to it?

    : /

    Assuming that mysql is running, can you used something like phpMyAdmin to connect to and look at the database. I know there may be no tables but you should see reference to the database in phpMyAdmin.

    Hi, guys. I’m having what I think is a similar problem. I think everything was working properly Monday the 11th.

    –WP is not connecting to the localhost database (“Error establishing a database connection”).
    –I’ve checked to see whether mysqld is running; it is (I can see it in ps -aux and I can ping it with telnet).
    –However, I can’t log onto it directly (i.e., “/usr/local/mysql> ./bin/myslq blah blah”); I get an error (“Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock'”). (PhpMyAdmin won’t open it either, of course.)
    –But, /tmp/mysql.sock is there (zero length).
    –I rebooted the machine, but to no avail.
    –I edited wp-config.php to make it look for the socket directly and then gave it 127.0.0.1 in place of localhost; these didn’t do it, either (unless I have to restart apached or some such after having done so).

    Sorta stymied….

    https://JohnL.edschool.viriginia.edu/blogs/spedpro/
    wp 2.05
    Mac OS X 10.4.[most recent for powerpc]

    @johnl–that looks like a different problem. Wonder if this will help you: https://www.tech-recipes.com/mysql_tips762.html

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error establishing a database connection!’ is closed to new replies.