CentOS 6.5,当运行
rake db:create RACK_ENV=production
错误: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file rake db:create Can't initialize character set utf8mb4
数据库配置文件
ActiveRecord::Base.configurations[:production] = {
:adapter => 'mysql2',
:encoding => 'utf8mb4',
...
my.conf
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_general_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_general_ci |
| collation_server | utf8mb4_general_ci |
+--------------------------+--------------------+
10 rows in set (0.00 sec)
mysql>
Mysql version:
Server version: 5.6.23 MySQL Community Server (GPL)
求帮助,谢谢 --------------- 折腾了一整天最终我把 :adapter => 'mysql2', 改成 :adapter => 'mysql' 就可以了,请问他们什么区别?