Support » Fixing WordPress » Database Error

  • New to WP… Great product so far, just a couple hangups… first of all I’m using WP 2.2, PHP 4.3.11, MySQL 4.1.7

    2 of the plugins I’ve tried to install today have had problems. Ultimate Tag Warrior and WP Polls. The installs went fine, but the use of both generated Databsae errors like this:

    WordPress database error: [Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘=’]

    Any ideas? I did see a note on the WP install about problems with MySQL 4.1.7, but since the install went fine and all basic functionality (and most plugins) seem to be working fine, I assumed the problem has been fixed.

    Oh yeah… and I’m hosting on a Windows server if that matters.

Viewing 11 replies - 1 through 11 (of 11 total)
  • OK – found out something new… I looked at my MySQL database in phpMyAdmin and see that even though my database is set to utf8_general_ci, some of the tables used by the 2 plugins with the problem are set to latin1_swedish_ci.

    Did I do something to cause this? I’m assuming I can change those tables to be utf8_general_ci, but I’m not really a php (or technical) guru.

    Thoughts? Thanks.

    I’m getting it by the ton on my WPMu install. Looking at the webserver logs, the IP addresses involved, etc, I say Koren porn spammers.

    I haven’t been worrying about it althoug it is filling our error logs.

    edit: I’m also seeing it show up with the ShortStat plugin tables as well.

    Sorry… I don’t understand what this has to do with spammers. It looks like the plugin tables themselves aren’t set to the right character set.

    I think the problem here is in the 2.2 release the wp-config.php has a database collation command.

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

    Most servers default to latin1_swedish_ci which is perfectly fine. The problem is if you’ve done a previous install with this default, then run the new wp-config.php on an upgrade you run into problems.
    The new wp-config.php should only be used on new installs.

    hmmm… ok, but I’ve only done one install. How do I get around this?

    Yup, how do we? 🙂

    The reason why I say comments as well is because I get my logs filled with teh following:

    [04-Jun-2007 13:50:06] WordPress database error: [Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=']
    SELECT comment_ID FROM wp_87_comments WHERE comment_post_ID = '2' AND ( comment_author = 'Âàñÿ Ïóïêèí int.' OR comment_author_email = 'root999@mail.php' ) AND comment_content = '[Insert lots of spam links here]' LIMIT 1

    I also see it a lot on the stats tables as well.

    Could it have something to do with it being on a Windows server?

    just a word of warning, wp-polls is a massive server hog. Be careful using that. I’m on a load balanced grid service and wp-polls was using up over 30% of my resources and I only had about five polls completed.

    Yeah. I’m having the same issue with the Recents Posts plug. Illegal mix of collations.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Database Error’ is closed to new replies.