Illegal mix of collations error

Tables and columns in a MySQL database are created with a “collation”, which dictates what characters can be used in the information. When new tables or columns are added to your TNG database during an upgrade, the database will use its default collation to create those. Normally that’s what we want, but if your default collation has changed since your tables were originally created, then you could end up with a mismatch that MySQL doesn’t like. That when you’ll see this message like this on your TNG site:

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE)

To fix this, you’ll need to edit your database structure and fix the mismatch so that everything is using the same collation.

Start by opening phpMyAdmin on your site control panel (aka, the “cpanel”). Ask your hosting provider if you need help finding it (it’s not part of TNG).

Once you’re in phpMyAdmin, select your database by clicking on it in the left column. You should now see all the tables in the database on the right, and one of the things listed for each table is the collation. Scan the list and take note of the predominant collation (the one used the most).

Next, click the Operations tab at the top of the page. In the Operations window, look for the Collation section near the bottom. It looks like this:

Now use the dropdown list to select the predominant collation you noticed earlier, then check the boxes below to propagate the collation to all tables and columns:

Finally, click “Go” in the lower right corner to make the change.