Houston, we have a problem.

It's never 'fun' upgrading a previous site to zc157, especially when the database contains the dreaded mixed collations. I've had the pleasure of updating a couple of sites that started with a mixture of various flavors of latin1 and utf8 and adopted the following procedure for those upgrades.

  1. Change the site's configure.php files, setting DB_CHARSET to 'latin1'.
  2. Run /zc_install/sql/install/zero_dates_cleanup.sql. Make sure it's the updated version of that script which uses the MySql CAST function.
  3. Run /zc_install to upgrade the site's database.
  4. Run the (older) convert_db2utf8.php script.
  5. Change the site's configure.php files, setting DB_CHARSET to 'utf8'.
  6. Run the utf8mb4_conversion.php script.
  7. Change the site's configure.php files, setting DB_CHARSET to 'utf8mb4'.


All was going well, until I added a plugin whose installation adds a table which includes one or more character (i.e. 'char' or 'varchar') fields. When that table was added, it and its fields' collations were set to 'utf8mb4_unicode_520_ci'. Unfortunately, while the pre-existing tables' collations were set to 'utf8mb4_unicode_520_ci', those tables' fields were set to 'utf8mb4_general_ci'. When a SQL query that binds the newly-added table to a pre-existing one, I was met with:

HP Fatal error: 1267:Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '='

I was able to correct the issue by logging into the site's webhost and, using phpMyAdmin's Operations tab, changing the collation of the database, all tables and all table fields to utf8mb4_general_ci.