Support » Installing WordPress » wp-config differences in 2.2 — should I add DB_COLLATE or avoid it?

  • My wp-config looks like this

    define('DB_NAME', 'my_name');     // The name of the database (DG also have 'my_name')
    define('DB_USER', 'my_name');     // Your MySQL username
    define('DB_PASSWORD', 'my_password'); // ...and password
    define('DB_HOST', 'localhost');     // 99% chance you won't need to change this value

    wp-config-sample from WP 2.2 looks similar but it adds this:

    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    When I upgraded from 2.0.x to 2.2, I followed the Upgrade Instructions in the Codex, which tells me to copy my old wp-config. Therefore the DB_CHARSET and DB_COLLATE are not in my wp-config.

    Should I add those 2 lines? Where does it tell me to do this, in the documentation or Codex? Is it safe to just add those 2 lines, and save the file?

    Yes, I have read the following pages in the Codex, and they are either Rough Drafts, or tell me NOT to add the above lines:

    But I’m still wondering if I need those lines, because I am having a lot of character encoding issues, and also my feed doesn’t work and the validation error mentions the utf8.

Viewing 10 replies - 1 through 10 (of 10 total)
  • If you are using an upgraded database do NOT put those two lines in your wp-config.php. If you have a new install of 2.2, then it is okay to have those lines in that file.

    I do have to quote this from the

    * Warning for those performing upgrades: If DB_CHARSET and DB_COLLATE do not exist in your wp-config.php file, DO NOT add either definition to your wp-config.php file unless you read and understand Converting Database Character Sets. Adding DB_CHARSET and DB_COLLATE to the wp-config.php file, for an existing blog, can cause problems — as Ryan Boren says, “your queries will go boom!”

    Thanks for the answer.

    I did read that paragraph in the Codex. But since I was still having problems I wanted to double-check it was accurate and applied to me.

    Maybe we should add somewhere in the upgrade instructions that, seemingly, automatic Fantastico upgrade overrides the old config file (adding the charset and collate lines) which makes the non-English blogs to “go boom”…

    There might be other issues, too, but this one stood out in several topics about upgrade to 2.2.

    Special note for Fantastico Upgrades has been added to Upgrading WordPress. If there is a suggestion for better placement of this information, please say so.

    Thanks Michael. I have no idea where else it should be – I’ll take a look at the upgrade section, although I am afraid those who go with Fantastico will not read the Upgrade instructions anyway… only after their blog “goes boom” 🙂

    I agree with you there…I’ve also noticed a number of cases where people are using the new wp-config-sample.php (non-Fantastico upgrades) and I’m not sure where (or if) to put a warning for that!

    How about putting the warning as Commented-Out text INSIDE the wp-config-sample.php file?

    At least for WP 2.2.1, that could help some people (non-Fantastico).

    There’s already other commented-out comments in there, such as “99% chance you won’t need to change this value” next to ‘localhost’. So there is a precedent for writing helpful 1-liners in the actual file.

    Also: on the Fantastico front, how about contacting Fantastico and see if they can stop serving their upgrade in that manner? Or if they can warn their users? I realize Fantastico is not WP’s responsibility, but that might be one of the quickest ways to resolve the amount of incoming problems.

    Yes, but that’s done by the developers – not by the non-developer helpers in the forum 🙁

    Message placed on Fantastico forums:

    That’s some support magic right there ^^

    Hopefully Fantastico themselves will heed the advice, as well as any users who have the problem finding your thread.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘wp-config differences in 2.2 — should I add DB_COLLATE or avoid it?’ is closed to new replies.