I have a multisite configuration with 9 sites/databases hosted on Acquia. I'm not able to access my.cnf, but when I check the configuration using MySQL Workbench, I can see that I have the prerequisite settings listed in the docs (large prefix, file format, and files per table). My Drupal status report page tells me "4 byte UTF-8 for mysql is not activated, but it is supported on your system".

When I run drush utf8mb4-convert-databases, everything seems to go well. The script runs through the tables of each database and reports that they are converted. But the script doesn't stop at the last database. It goes on to attempt to convert database "default." Then it crashes, because there is no database "default." I wonder if this is a multisite issue, since there's always a site called "default" in a multisite configuration? We have one, but the database isn't named similarly (I called this db "gamma" below).

When this process is finished, nothing has changed on my sites. After the final step of enabling utf8mb4 in settings.php, the status report still says "not activated," and I still can't use multi-byte characters.

Here's the error message I'm getting. Note that gamma is the db that goes with the default site, but it has already been converted by this point! The script runs through them in alphabetical order, but then returns to gamma for some reason.

Target MySQL database: gamma@staging-5808 (default:default)
Error while sending QUERY packet. PID=24596 database.inc:2227                                                                                                                                                                     [warning]
The default:default MySQL database does not support UTF8MB4! Ensure that the conditions listed in settings.php related to innodb_large_prefix, the server version, and the MySQL driver version are met. See https://www.drupal.org/node/2754539 for more information.
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /my/path/docroot/includes/database/database.inc:2227                                                    [error]
Stack trace:
#0 /my/path/docroot/includes/database/database.inc(2227): PDOStatement->execute(Array)
#1 /my/path/docroot/includes/database/database.inc(697): DatabaseStatementBase->execute(Array, Array)
#2 /my/path/docroot/includes/database/select.inc(1280): DatabaseConnection->query('SELECT 1 AS exp...', Array, Array)
#3 /my/path/docroot/includes/database/query.inc(1615): SelectQuery->execute()
#4 /my/path/docroot/includes/bootstrap.inc(1240): MergeQuery->execute()
#5 /my/path/docroot/home/dev/.drush/utf8mb4_convert/utf8mb4_convert.drush.inc(253): variable_set('drupal_all_data...', true)
#6 [internal function]: drush_utf8mb4_convert_databases()
#7 /usr/local/drush8/vendor/drush/drush/includes/command.inc(422): call_user_func_array('drush_utf8mb4_c...', Array)
#8 /usr/local/drush8/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#9 [internal function]: drush_command()
#10 /usr/local/drush8/vendor/drush/drush/includes/command.inc(199): call_user_func_array('drush_command', Array)
#11 /usr/local/drush8/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#12 /usr/local/drush8/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /usr/local/drush8/vendor/drush/drush/drush.php(12): drush_main()
#14 {main}

Comments

alrueden created an issue. See original summary.

alrueden’s picture

Issue summary: View changes
alrueden’s picture

Worked with Acquia to get this figured out. Looks like whatever is going on at the end, it causes the entire operation to fail. The workaround is the same as for #2763135: Specify databases to convert; Do not convert all databases by default - convert each database individually. However, the patches written for 7.x-1.0-beta2 do not apply cleanly to 7.x-1.0-rc1. If you're using version 7.x-1.0-rc1, try the following patch: https://gist.github.com/pbull/79f4599b4483d493dfe63a7ecc8d57eb.