在 /etc/mysql/my.cnf 中增加:
[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=true
然后重启 mysql 服务:
sudo service mysql restart
安装 drush 模块:
drush @none dl utf8mb4_convert-7.x
清空 drush 缓存
drush cc drush
转换数据库表:
drush utf8mb4-convert-databases
修改配置 settings.php
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
);
原文链接 https://www.drupal.org/node/2754539
https://www.drupal.org/project/utf8mb4_convert