• Well, after having this site working just fine for weeks on an XP localhost setup, I just noticed that the wp-config file in the wordpress folder has the original wp-config-sample.php file name.

    I think “that’s not right,” and change the name of the file to wp-config.php. As soon as I did that, the site won’t load and I get this:

    “ERROR ESTABLISHING A DATABASE CONNECTION
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.”

    When I change it back to wp-config-sample.php, the site admin page loads, and everything works fine.

    As I recall, when I installed WAMP and wordpress about a bizillion years ago, I renamed the wp-config-sample.php file per WAMP installation instructions.

    NOTE:
    Some time ago, I added a new “user”, deleted the “root” user, and added a login password for security reasons. Everything has been working fine, until just a few minutes ago when I discovered this config naming thing and changed the name to wp-config.

    Anyone got any idea how it became wp-config-sample.php again, and why wordpress works just fine with that name? Shouldn’t it be wp-config.php?

    Thanks for any help anyone has to offer.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator cubecolour

    (@numeeja)

    Did you move the wp-config.php up a directory level?

    If so the wp-config-sample.php file remains in place within the public_html (or equivalent). I would guess that renaming that dummy file to wp-config.php file would cause WP to look at it before looking for the real one up a directory causing the error msg.

    Thread Starter adhdcelt

    (@adhdcelt)

    Wow.
    Yes! A big YES, per your generous reminder, I remembered moving the wp-config file up one level.

    And yes, that did solve the problem: Thank you so much!

    However, while I have your brilliant mind here, after taking a look in the “real” config file, I noticed that the DB_USER name is still listed as “root,” and it’s also listed as “root” in the mysql database “user” table as well. I actually created a new database user name long ago and deleted the “root” user. There’s only one user listed now in my database “_users” table.

    You think it would be wise to change that “root” user name to the present database user name in both wp-config file and the mysql database “user” table for security reasons?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site works wp-config-sample.php, but not with wp-config.php????’ is closed to new replies.