Skip Navigation

WordPress database error COLLATION “utf8_general_ci” is not valid for CHARACTER SET “utf8mb4”, when using Toolset Maps

Resolved

Reported for: Toolset Maps 1.8

Resolved in: 2.0.1

Symptoms

When using Toolset Maps, actually, when activating it, you might see the following error on the screen or in the error logs:

  • WordPress database error COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4' for query CREATE TABLE wp_toolset_maps_address_cache

This means that the wp_postmeta table on your site is using the utf8_general_ci collation, which cannot use utf8mb4 character set.

Toolset’s code adjusts to different collations of the wp_postmeta table when creating a Toolset-related table, but it doesn’t adjust to different character sets.

Because WordPress should, at least in theory, always use utf8mb4, collations which don’t support that character set can’t work.

Workaround

Our developers are looking into possible solutions.

If you are experienced in SQL Database Editing, you can use the following steps to alter the charset:

  1. Enter the admin for editing your database (i.e. phpMyAdmin).
  2. Open the postmeta table.
  3. Open the structure tab.
  4. Select the checkboxes for meta_key and meta_value rows and click Edit.
  5. Change the collation column (it’s a select dropdown) from the existing collation, for example, utf8mb4_unicode_ci to utf8mb4_unicode_520_ci (you just need to select it).
  6. Save the changes.

Comments are closed