• Resolved elliekennard

    (@elliekennard)


    For the site:
    https://www.shadowsandlight.ca
    I was getting nicely through the upgrade process and had gone into my dashboard (the update notice was no longer showing so obviously this had worked). I then as suggested, took a look at the wp-config.php file to see what had changed since my very old one. I updated this to include the Authentication Unique keys and salts. I also inserted these lines which I did not have in my old one:
    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

    As soon as this new file was uploaded I got the error message “Error establishing a database connection” and the site is down for all intents and purposes.

    I then undid the changes in my wp-config.php file so it was back as it had been. I uploaded this file, but still I get the same error message. My site is not accessible. What can I do to correct this?

    Thanks,

    Ellie

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter elliekennard

    (@elliekennard)

    Any thoughts on this? My site is down and I am stuck as to how to fix it.

    Thanks,

    Ellie

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Upgrading from what to what? I’m assuming TO 3.0.4 but what from?

    I then as suggested, took a look at the wp-config.php file to see what had changed since my very old one. I updated this to include the Authentication Unique keys and salts.

    Suggested by whom? (Yeah, maybe me, since you tagged the post for me, but I don’t actually remember ever bit of advice I put out ?? ) Basically where did you read this?

    Thread Starter elliekennard

    (@elliekennard)

    HI
    Thanks for the reply.

    No, it was not you who suggested it, it was in the notes on how to upgrade to a new version. The previous version I was upgrading from was, I believe, 3.02. I don’t have the files in front of me now, but it was not an old version I was running.

    But how can I fix this? What did that do to my access to my database? I have uploaded the old file as it was before I made those changes, but it won’t still work.

    Many thanks.

    Ellie

    Thread Starter elliekennard

    (@elliekennard)

    Actually the words are found here:

    https://codex.www.ads-software.com/Updating_WordPress
    And down near the bottom in the manual update section:
    “Lastly you should take a look at the wp-config-sample.php file, to see if any new settings have been introduced that you might want to add to your own wp-config.php. “

    Cheers!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Can’t tell you how to fix it unless I know what went into breaking it yanno ?? S’why I wanted to know what you upgraded from and what directions you followed. Have faith, patience and remember we all go home once in a while.

    Okay. There was no database upgrade from 3.0.1 to 3.0.4 (see? It matters, there was was 3.0 to 3.0.1!), so the most likely way of this happening is that when you edited your wp-config.php file, you somehow edited the lines for your database define.

    Go in via your host’s control panel (usually cpanel or plesk these days) and check if the database listed IN your wp-config.php file is actually there.

    Make sure its name (usually it’s something like elliekennard_wprd1 or such) is the same as in your wp-config.php

    Make sure the USER ID and PASSWORD are correct, too.

    Thread Starter elliekennard

    (@elliekennard)

    Thanks for the reply, Ipstenu.

    I do appreciate that we all have to go home sometime! :o)

    I know that I did not change any of the database lines in the wp-config.php file, as, once I realised the error, I uploaded the file from my backup, so it was exactly as it had been prior to the update.

    I will go in and see that everything in the cpanel database is as expected tomorrow. I backed up the database prior to doing the update (as well as the content), so can’t imagine that the database would have changed in any way.

    The strange thing was that I had it working fine after the upgrade until I uploaded the edited wp-config.php file (as I should not have done). This broke it, and even restoring the backed up file has not repaired it.

    I will see what I find tomorrow.

    Thanks again.

    Ellie

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yeah, see since it broke when you edited the wp-config.php, the most likely culprit is an accidentally edit, a typo, or just a file corruption. All of which happen to everyone.

    Even though you KNOW you didn’t change those lines, never assume they didn’t get somehow goobered. I mean, if you edited the file from your hard drive, without copying a fresh copy DOWN from your server first, that could do it easily.

    Thread Starter elliekennard

    (@elliekennard)

    Thanks so much, Ipstenu.

    I took what you gave me last night and went into cpanel to see what was going on with database users/passwords etc. I created a new user, new password and filled that info into the wp-config.php file. Having added that user to the database, the site is now working again!! Thanks for giving me that clue. Panic tends to drive reason out of the door… at least for me.

    Now, do you think that I should go in and add the Authentication Unique keys and salts and these? Or leave well enough alone?:
    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The keys and salts are FINE to change. Leave the db_charset alone.

    The charset is … well if you started WordPress on a pre 2.2 install, it’s a pain in the ass to correct. If you made this post 2.2, you’re fine.

    Read up at https://codex.www.ads-software.com/Converting_Database_Character_Sets to see HOW painful it is ??

    Thread Starter elliekennard

    (@elliekennard)

    Tried inserting the keys and salts, but was getting an error message to do with the key at line 18, so have now removed them. It was copied exactly, but won’t work with that line, apparently. I presume it is just for added security. Perhaps I should get a new one? If so, do I just refresh the page that gives the codes for new values?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You got the codes from https://api.www.ads-software.com/secret-key/1.1/salt right?

    Sometimes, servers don’t like the special characters. Go through and make them all alphanumeric and see if that helps.

    Thread Starter elliekennard

    (@elliekennard)

    Works fine now. Must have been something funny in the codes generated the first time.

    Thanks for all the help. Will mark this resolved.

    Cheers!

    Ellie

    Hi,

    Just installed a new WP (using Fantastico).
    It’s been a while since I’ve done an install, and I was surprised to see that the wp-confgi file had already been “salted”.

    I went to – https://api.www.ads-software.com/secret-key/1.1/salt/
    to replace them, and found that the new strings were shorter.
    Further examination, found that the lines that were there originally all contained the domain name.

    Is it necessary now for those lines to have the domain?
    Are the install settings already unique?
    And finally, should I leave them as is?

    Thanks!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    mtngr – No, the lines don’t need the domains, yes they’re unique, yes you can leave them alone, and next time? Open a new topic. Your question has nothing to do with the topic at hand.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Updated to new version now get Error establishing a database connection’ is closed to new replies.