PHP PDOException: SQLSTATE [HY000] [2019] Unable to initialize utf8mb4 character set

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: October 16, 2015 08:41:09)

But I still get a connection error

PDOException: SQLSTATE [HY000] [2019] Unable to initialize utf8mb4 character set (path: / usr / share / mysql / charsets /) in / var / www / m 2m / core / lib / Drupal / Component / DependencyInjection / PhpArrayContainer.php in 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: October 31, 2015 07:39:39)

and everything is in order.

Do you have any ideas? Any help would be appreciated

+5
source share
1 answer

I had the same issue with CentOS as all modern packages. The problem was with the mysql driver. Fixed by doing the following:

yum erase php56w-mysql yum install php56w-mysqlnd 

And restarting the web server.

+7
source

Source: https://habr.com/ru/post/1236463/


All Articles