Can't install because of an error.
[root@CentOS-68-64-minimal directus]# bin/directus install:database�
Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
There was a problem connecting to the database: SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/)
Mysql reports:
[root@CentOS-68-64-minimal directus]# mysqladmin -u root -p var | grep -E 'character|collation' | tr -s ' '
Enter password:
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | utf8mb4_unicode_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
| session_track_system_variables | autocommit,character_set_client,character_set_connection,character_set_results,time_zone |
I am running on CentOS release 6.10 (Final), with MariaDB-server.x86_64 10.3.14-1.el6, and .
What can I do to make it work? I can't find anything on Google and I'm lost.
What's you MySQL version?
This looks like an issue with the default charset added in this past release:
https://github.com/directus/api/commit/964fd4451d9037aa85da3df5a5fb1e36d810caea
@rijkvanzanten , MySql version is 10.3.14, 10.3.14-MariaDB-log.
@benhaynes What can I do to bypass and successfully install it?
I ended up fixing this with adding the following code to /usr/share/mysql/charsets/Index.xml:
<charset name="utf8mb4">
<family>Unicode</family>
<description>UTF-8 Unicode</description>
<collation name="utf8_bin" id="83">
<flag>primary</flag>
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
I think everything is working now, even though I am not 100% sure.
Between the error message and your resolution—that looks like a good solution.
I'm going to close this issue now, as it appears solved by that missing charset.
If this comes up again, we should figure out why certain databases aren't accepting utf8mb4... since that's now part of the install process.
Is this an issue that's happened before? As far as I'm aware utf8mb4 is well supported.
It was added in MySQL 5.5, therefore, any issue is _likely_ due to user configuration. Perhaps a migration failure in an upgrade through 5.5 or something? Where the charset was never added to the user MySQL installation.
Resource: https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
I think it might be tied to MariaDB in this case... because MySQL should be fine. :)
Is this an issue that's happened before? As far as I'm aware utf8mb4 is well supported.
It was added in MySQL 5.5, therefore, any issue is _likely_ due to user configuration. Perhaps a migration failure in an upgrade through 5.5 or something? Where the charset was never added to the user MySQL installation.
Resource: https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
Yes, I am thinking the same. I think it might just be something that they forgot to include in the latest package.
Most helpful comment
I think it might be tied to MariaDB in this case... because MySQL should be fine. :)