Changes to default charset in bedrock config

This is not specifically a bedrock issue, but is related to Use DB_CHARSET utf8mb4 by default · Issue #230 · roots/bedrock · GitHub. Since merging this change when I deploy (using trellis) to my staging server and it runs ‘wp core update-db’ I get the following error:

PHP Warning: mysqli_set_charset(): Error executing query in /blah/blah/releases/20160511153721/web/wp/wp-includes/wp-db.php on line 782

So I did some googling but all I got were WordPress support forums posts with people suggesting to disable PHP warnings (since when is that a solution!?). Anyway, I understand the change, I understand why it was done, what I don’t understand is why the error is occurring. I am running PHP 5.5 and MySQL 5.1.73. Is there a specific privilege associated with this function that my DB user needs? I really wish the error had some more information.

If anyone has any ideas I would appreciate it. I would really like to be running everything on the latest Bedrock release and not introduce my own changes (editing the default charset back to UTF8) unless I know it is absolutely necessary.


So I went into core and added the following"

mysqli_set_charset( $dbh, $charset ); echo mysqli_errno($dbh) . ": " . mysqli_error($dbh) . "\n";

In order to get a more meaningful error. This resulted in:

1115: Unknown character set: 'utf8mb4'

So simply put - my mysql server version does not support this character set. My organization is on RHEL6 which only supports 5.1.x. Hilarious to me that using an enterprise linux distro gets me an older MySQL version than some shared hosting site.