[wp-trac] [WordPress Trac] #57072: WordPress 6.1 uses wrong database collation
WordPress Trac
noreply at wordpress.org
Fri Nov 11 10:35:00 UTC 2022
#57072: WordPress 6.1 uses wrong database collation
--------------------------+-----------------------------
Reporter: Krstarica | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: 6.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
After upgrade to WordPress 6.1 some plugins started reporting "WordPress
database error Illegal mix of collations (utf8mb4_unicode_520_ci,IMPLICIT)
and (utf8mb4_unicode_ci,IMPLICIT)". See:
https://wordpress.org/support/topic/database-error-after-upgrade-to-
wordpress-6-1/
It seems that WordPress 6.1 wrongly detects database collation. This is
probably related to #54841.
Database section of the Site Health page (/wp-admin/site-
health.php?tab=debug) displays:
{{{
Database charset utf8mb4
Database collation utf8mb4_unicode_520_ci
}}}
Eariler versions displayed correct one:
{{{
Database charset utf8mb4
Database collation utf8mb4_unicode_ci
}}}
Database collation should be utf8mb4_unicode_ci per server and database
configuration:
{{{
MariaDB [(none)]> SHOW VARIABLES LIKE '%_server' ;
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| character_set_server | utf8mb4 |
| collation_server | utf8mb4_unicode_ci |
+----------------------+--------------------+
2 rows in set (0.002 sec)
MariaDB [(none)]> USE wordpress;
Database changed
MariaDB [wordpress]> SELECT @@character_set_database,
@@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8mb4 | utf8mb4_unicode_ci |
+--------------------------+----------------------+
1 row in set (0.000 sec)
}}}
Server version: 10.6.10-MariaDB-log
Having {{{define('DB_COLLATE', '');}}} in wp-config.php.
Using {{{define( 'DB_COLLATE', 'utf8mb4_unicode_ci' );}}} did not fix the
issue, nor changed collation information in Database section of the Site
Health page.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57072>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list