5

I have drupal 8 installed on Centos 6. Here is my php and mysql -version output

Server version: 5.7.9 MySQL Community Server (GPL) PHP 5.6.14 (cli) (built: Oct 16 2015 08:41:09)

But i still getting a connection error

PDOException: SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/) in /var/www/m2m/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php on line 83

I also have this configuration on my OS X Mysql Server version: 5.6.27 Homebrew and PHP 5.6.15 (cli) (built: Oct 31 2015 07:39:39)

and everything is ok.

Do you have any idea? Any help will be appreciated

7
  • Can you try SET NAMES 'utf8mb4' ? http://dev.mysql.com/doc/refman/5.7/en/charset-connection.html – pavlovich Nov 20 '15 at 19:34
  • Log in to MySQL and run show character set like 'utf%'; , do you see utf8mb4? – Sasha Pachev Nov 20 '15 at 22:16
  • mysql> show character set like 'utf%' -> ; +---------+------------------+--------------------+--------+ | Charset | Description | Default collation | Maxlen | +---------+------------------+--------------------+--------+ | utf8 | UTF-8 Unicode | utf8_general_ci | 3 | | utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 | | utf16 | UTF-16 Unicode | utf16_general_ci | 4 | | utf16le | UTF-16LE Unicode | utf16le_general_ci | 4 | – vaninv Nov 21 '15 at 0:06
  • jumanji, i'm can't do this, because it should work from the box, and it works perfect on my OS X – vaninv Nov 21 '15 at 0:08
10

I had the same problem on CentOS, all packages up-to-date. Issue was with the mysql driver. Fixed by running the following:

yum erase php56w-mysql
yum install php56w-mysqlnd

And restarting the webserver.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.