Database character set and collation
-
My site has been on WordPress just over 3 years I think. About 6 months ago I migrated to a different host.
Recently an error showed up in debug log when someone tried to spam my site. It began like this, followed by a bunch of spam content:
[18-Dec-2020 17:00:52 UTC] WordPress database error Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,COERCIBLE) for operation 'like' for query SELECT SQL_CALC_FOUND_ROWS wp75_posts.ID FROM wp75_posts WHERE 1=1 AND wp75_posts.ID NOT IN (5729,5709,4178,2170,2433,1966,1908,1800,650,76) AND (((wp75_posts.post_title LIKE . . .
Someone told me this indicates a problem in my database, that I have the wrong character set and/or collation. wp-config.php has:
define('DB_CHARSET', 'utf8'); define('DB_COLLATE', '');
In phpMyAdmin, it shows Server connection collation is “utf8mb4_unicode_ci”, and Server charset is “UTF8 Unicode (utf8mb4)”. But the tables have a variety of collations:
utf8mb4_unicode_ci (tables of 2 plugins) utf8mb4_unicode_520_ci (only one plugin table has this) utf8_general_ci (all WP core and Wordfence tables)
The site seems to work okay. Do I have a problem? I’ve seen a lot of different ideas about how to fix this if necessary, and would appreciate some authoritative pointers. Thanks.
The page I need help with: [log in to see the link]
- The topic ‘Database character set and collation’ is closed to new replies.