Question

I am on a shared host and I have the following error during instalation:

Error during installation:
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/).

Answer

Contact your host and ask them to use the mysqlnd driver with pdo_mysql.

DomainFactory is looking to do the switch-over on October 20th:

From: <technik@df.eu>
Date: 2015-09-24 9:31 GMT+02:00
Subject: [domainfactory.de] Drupal 8 support

Hi Stefan,

we did our research and can confirm that the setup of drupal 8 works fine
when we use pdo_mysql with mysqlnd. I think thats our prefered
solution/workaround, we'll try to update our system before your release date
(October 20, 2015).
[...]
We will communicate the solution to our customers so they stop posting in
your comment section ;)

Kind regards
redacted
Senior Systemadministration
CommentFileSizeAuthor
domainFACTORY Systeminformationen.htm_.txt77.37 KBansorg

Comments

sachbearbeiter’s picture

hi,

are you shure, this is a general df problem, because in this posting from 2013 it sounds like: we support utf8mb4?!
https://www.df.eu/blog/2013/01/30/neu-mysql-5-5-verfugbar/

regards sb

ansorg’s picture

Not 100% sure but according to the replies I got from service desk utf8mb4 does not work right now:

Wir haben soeben eine Anpassung am Server vorgenommen wodurch es Ihnen nun möglich sein sollte die Tabellen von Drupal 8 mit dem Zeichensatz utf8mb4 anzulegen, wir würden Sie bitten dies einmal zu testen.

and later ... (before I could run a test)

die gemachte Änderung mussten wir leider wieder rückgängig machen da dies zu Initialisierungsfehlern des UTF8 Zeichensatzes führte, wir werden dies noch weiter prüfen und uns dann wieder bei Ihnen melden

hopefully they can sort this out soon

sachbearbeiter’s picture

this sounds not good and would be a major problem for germany, because of the number of people using df as hoster (direct or as reseller) ...
we have also a df account - i will ask the support ...

ansorg’s picture

Title: cannot install at shared hoster DomainFactory due to unsupported utf8mb4 Charset » cannot install at shared hoster DomainFactory and Strato.de due to unsupported utf8mb4 Charset

Had a chance to try this at Strato.de. Seems there is a similar issue :-(

Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /opt/RZmysql5/share/mysql/charsets/).

alexej_d’s picture

Same issue with 1and1 (called 1und1 in Germany).

stefan.r’s picture

Likely they don't comply with the MySQL minimum version requirements (both libmysqlclient and mysql server need to be 5.5.3 or up per #2473301: Raise MySQL requirement to 5.5.3), we are working on better error messages in the installer for this in #2529188: Provide better error handling for MySQL client and server utf8mb4 incompatibility

stefan.r’s picture

Category: Bug report » Support request
Frogger80’s picture

Hello,
I tried to install Drupal 8 Beta 14 also on a Strato Account.
The Database is MySQL 5.5.44. I selected Charset: UTF8mb4_general_ci.
But I got same error:
The server reports the following message: SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /opt/RZmysql5/share/mysql/charsets/).

Is this issue still on provider side? Any chance how to check the root cause without asking provider Support?

regards Frogger

ansorg’s picture

Latest answer from DomainFactory Support does not sound promising :-(

Basically, they cannot enable utf8mb4 because for some technical reasons that would require to convert all existing databases.

wir haben nun einiges an Recherche betrieben und auch einige Tests durchgeführt aber es scheint keine Lösung zu geben den Zeichensatz utf8mb4 optional zu machen. Die Verbindung kann nur hergestellt werden wenn sämtliche Defaultzeichensätze bzgl Verbindung und Tabellen utf8mb4 nutzen. Wir können jedoch keine Konvertierung sämtlicher Datenbanken und Tabellen vornehmen da dies erstens sehr lange benötigten würde während wir Änderungen unterbinden müssten und zweitens kommt es dann zu Verbindungsfehlern bei anderen Anwendungen die einen anderen Zeichensatz eingestellt haben. Aktuell sehen wir daher hierbei keine Möglichkeit dies umzusetzen.

Now, according to the discussion in https://www.drupal.org/node/1314214#comment-10097446 ff. this is more a libmysql issue than something on the database itself. I will try to continue discussion with DomainFactory on this topic

stefan.r’s picture

Now that #2529188: Provide better error handling for MySQL client and server utf8mb4 incompatibility is in on HEAD you should be able to see if the problem is libmysqlclient or the server... If it's the former, they may not be correct about "having to convert all databases"

ansorg’s picture

Version: 8.0.0-beta12 » 8.0.0-beta15
Category: Support request » Bug report
stefan.r’s picture

Category: Bug report » Support request

@ansorg could you clarify why this is a bug? HEAD shouldn't ever give the error in #4 anymore, at least in the installer. You can run the installer with Drupal HEAD to find out what the issue is...

Per #2473301: Raise MySQL requirement to 5.5.3 Drupal 8 needs mysql 5.5.3 for both libmysqlclient and the server, and it seems like your host doesn't have the right client library?

musikscontact’s picture

Same issue with OVH in France with MySQL 5.5.4.

stefan.r’s picture

@musikscontact - until a few days ago our error messages were wrong (see #2558615: Error message in MySQL client version check shows server version instead of client version ). Install the HEAD version of Drupal on OVH to find out what the issue is, most likely their drivers are not 5.5.4

musikscontact’s picture

Phpmyadmin show me Mysql ver. 5.5.44 (command SHOW GLOBAL VARIABLES LIKE '%version%';).
What is the Head version of Drupal ?
I try to install Beta 15 of Drupal.

stefan.r’s picture

@musikscontact that is the server version, we're interested in the libmysqlclient version instead.

Beta15 doesn't have this fix yet so you'll have to get a nightly release at https://www.drupal.org/node/2311847 and run the installer to get an accurate error message.

ansorg’s picture

Should I turn this into a feature request? like

"Allow utf8 fallback if utf8mb4 fails during installation"

I'd rather make it a critical/blocker bug and ask whether the decision to require this specific version of the mysql client library should be re-considered because it prohibits installation of Drupal 8 at several major shared hosters in Germany/Europe/World? Which would be a major hit to adoption of Drupal?

Ok, I have no numbers and cannot tell how serious this is but it sounds serious to me.
:-(

ansorg’s picture

Actually, I'm confused right now. So the actual error is not the "utf8mb4" anymore? Is drupal falling back to "utf8" if the other is not working? And now I'm really stuck because of the wrong client lib version, for whatever reason?

stefan.r’s picture

Your host likely has an outdated/unsupported client library (older than 5.5.3), run the installer on the nightly to find out what version they are running.

Some people solved the libmysqlclient issue by switching to the mysqlnd driver bundled with PHP.

stefan.r’s picture

@ansorg it's not the first time this has come up - there have been complaints from other people on shared hosts in the the issue queue. I think a MySQL utf8 fallback for Drupal 8 was decided against in #2473301: Raise MySQL requirement to 5.5.3 / #1314214: MySQL driver does not support full UTF-8 (emojis, asian symbols, mathematical symbols).

ansorg’s picture

But when I change that required version in \Drupal\Core\Database\Driver\mysql\Install\Tasks.php and run the installer again I'm back at the utf8mb4 issue. And if I hard-code just utf8 in \Drupal\Core\Database\Driver\mysql\Connection.php I can install and everything seems to work fine - for my usage scenario.

It will be a hassle to do this after every future update but I can live with that. Other DF/Strato/1&1 customers might see this different.

I guess this should rather go in https://www.drupal.org/node/2473301

musikscontact’s picture

Thanks @stefan.r. I try it.

stefan.r’s picture

@ansorg I'd be a bit worried about things breaking in unpredictable ways then when dealing with multibyte data though. If it works for your use case, fine, just bear in mind you'll be running on an unsupported setup.

Just to add to this, libmysqlclient 5.5 is five and a half years old at this point. Alternatively the mysql native driver that comes with PHP 5.5 is perfectly fine as for usage with Drupal 8 as well. So at some point I assume these hosts will be either upgrading their libmysqlclient libraries, or catering to this through a simple driver switch to mysqlnd.

I don't know if I'd believe their having to "convert all existing databases", so definitely keep on pressuring them, and switch if necessary - plenty of other shared hosts run setups that do meet the current Drupal 8 requirements.

musikscontact’s picture

Last Drupal Head version show me "driver version 5.1.73" with the same issue. Phpmyadmin show me a different version of Mysql (5.5.4). Which is correct ?
I will try to contact my host tomorrow. This is strange because OVH is a biggest web host in France.

stefan.r’s picture

5.1.73 is the libmysqlclient driver version - 5.5.4 is the server version.

ansorg’s picture

Latest response from hoster is that switching to different library would not help, they still would need to convert or update all existing databases to the new charset.

sachbearbeiter’s picture

a reply of df today:

"Die Problematik hat Ihre Ursache in Drupals Setup welcher in der aktuellen Version unbedingt den Zeichensatz utf8mb4 verwenden möchte, ein Fallback auf utf8 scheint seitens Drupal nicht in Frage zu kommen. Den letzten Meldungen nach wird dies jetzt auf die verwendete MySQL Client Library zurückgeführt wobei es unseren Recherchen nach jedoch auch mit dieser Clientversion funktioniert insofern am MySQL vorher alle Zeichensätze auf utf8mb4 umgestellt wurden. Aktuell ist es daher nicht möglich Drupal8 zu installieren, wenn dann müsste in den Scripten der Zeichensatz auf utf8 angepasst werden was dann aber vermutlich zu Problemen bzw Wiederholung der Schritte bei Updates führt. Wir können Ihnen derzeit daher nur empfehlen bspw eine JiffyBox für Drupal8 zu verwenden, ob und wann dies bei uns lauffähig ist können wir derzeit nicht sagen."

stefan.r’s picture

Issue summary: View changes

I have been in touch with DomainFactory and they are looking to do the switch-over to mysqlnd on October 20th:

From: <technik@df.eu>
Date: 2015-09-24 9:31 GMT+02:00
Subject: [domainfactory.de] Drupal 8 support

Hi Stefan,

we did our research and can confirm that the setup of drupal 8 works fine when we use pdo_mysql with mysqlnd. I think thats our prefered solution/workaround, we'll try to update our system (October 20, 2015) before your release date.
[...]
We will communicate the solution to our customers so they stop posting in your comment section ;)

Kind regards
redacted
Senior Systemadministration
sense-design’s picture

Great news, dF ist an awesome hoster and it would be terrible if there would not be a Drupal 8 support.

joelpittet’s picture

Version: 8.0.0-beta15 » 8.0.x-dev
Issue tags: +Needs product manager review
stefan.r’s picture

Title: cannot install at shared hoster DomainFactory and Strato.de due to unsupported utf8mb4 Charset » cannot install at shared hoster Strato.de due to unsupported utf8mb4 Charset

DomainFactory has already committed so solving this on 20 oct. Has anyone been in touch with Strato yet?

sachbearbeiter’s picture

I know it's not the 20th of October, but i had to try ;)
I still get:

Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider.

    Your MySQL server and PHP MySQL driver must support utf8mb4 character encoding. Make sure to use a database system that supports this (such as MySQL/MariaDB/Percona 5.5.3 and up), and that the utf8mb4 character set is compiled in. See the MySQL documentation for more information.
    The libmysqlclient driver version 5.1.61 is less than the minimum required version. Upgrade to libmysqlclient version 5.5.3 or up, or alternatively switch mysql drivers to MySQLnd version 5.0.9 or up.

If someone from Germany wants to know: Allinkl works ...

sense-design’s picture

domainFactory has not updated until now and other tasks have a higher priority so we have to wait for this. The support will inform me about an update. This is what the support told me.

sachbearbeiter’s picture

... the problem is still there ...

sense-design’s picture

Regarding domainFactory I opened up a request yesterday and I am waiting for the answer.

Anonymous’s picture

There are no new news from domainFactory. I try installing with Release 8.0.0 and it is not working.

tantebootsy’s picture

Today I've asked DF regarding the current status of this issue. They answered that it's currently possible to install Drupal via SQlite only and that they're already working on patching mysql and php to make it possible to install Drupal regularly with MySQL. As soon as they're finished they'll inform about this via newsletter + in the forum.

cilefen’s picture

xjm’s picture

Not sure why this issue is tagged for product manager review. Is there anything that needs committer signoff here? If so, it seems more of a framework manager issue if anything. Reference: http://cgit.drupalcode.org/governance/plain/drupal-core.html#product-man... versus http://cgit.drupalcode.org/governance/plain/drupal-core.html#framework-m...

However, we should probably have a specific proposal or decision in mind before tagging an issue. Maybe it would be helpful to update the issue summary with a few of the proposed solutions for this hosting support issue? Thanks!

cilefen’s picture

I am not even sure what needs fixing here. Drupal supports one of two MySQL integrations, each at a specific minimum version.

sense-design’s picture

Just received the following reseller newsletter from domainFactory.

In short: from the 13th of January Drupal 8 will be supported

---

Mail from support (in German)

+======================================+
Umstellung auf mysqlnd-Libary
+======================================+

Mit diesem Update werden alle PHP-Versionen ab PHP5-53STABLE auf die
PHP-eigene MySQL-Libary mysqlnd umgestellt. Für die Nutzung Ihrer Skripte
ergeben sich keine Änderungen, es stehen jedoch mehr Funktionalitäten zur
Verfügung. So ist damit nach dem Update auch die Nutzung des vor kurzem
erschienenen Drupal 8 bei uns möglich.

Alle Informationen zu der mysqlnd-Libary finden Sie unter
https://secure.php.net/manual/de/mysqlnd.overview.php

sense-design’s picture

Status: Active » Needs review
cilefen’s picture

Status: Needs review » Closed (works as designed)

@sense-design Thank you for the update. I think there is nothing else to be done on this issue. The database library requirement is clear.

muzi111’s picture

Hi All,

Can anyone please explain simply either this issue will resolve in coming release ? today i try to install drupal8.0.4 and still getting both errors.

Your MySQL server and PHP MySQL driver must support utf8mb4 character encoding. Make sure to use a database system that supports this (such as MySQL/MariaDB/Percona 5.5.3 and up), and that the utf8mb4 character set is compiled in. See the MySQL documentation for more information.
The libmysqlclient driver version 5.1.61 is less than the minimum required version. Upgrade to libmysqlclient version 5.5.3 or up, or alternatively switch mysql drivers to MySQLnd version 5.0.9 or up.

I am on Centos-6.7 using php-5.6 and mysql server 5.6 with utf8mb4

[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| 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 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
10 rows in set (0.01 sec)

And libmysqclient is 5.6 but still php API client shows 5.1.72 :(

rpm -qf /usr/lib64/mysql/libmysqlclient.so.16
mysql-community-libs-compat-5.6.29-2.el6.x86_64

So should i wait for fix in coming release or if there is any fix kindly let me know please.

stefan.r’s picture

@muzi111 your libmysqlclient is actually 5.1 rather than 5.6, even if the file comes from the mysql-community-libs-compat-5.6.29 package.

There is currently no fix planned so as mentioned in the error message, your best call is to switch mysql drivers to MySQLnd.

In CentOS I believe it would be yum install php56w-mysqlnd

muzi111’s picture

@stefan.r You great. Thanks a lot, by using mysqlnd issue has been resolved.