mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/sha
来源:互联网 发布:淘宝虚拟市场清退标准 编辑:程序博客网 时间:2024/06/05 19:29
1.场景:由于之前MySQL中一起使用utf8编码,最近由于emoji表情的原因,需要使用utf8mb4编码
操作如下:
修改配置文件/etc/my.cnf:
[client]
default-character-set=utf8mb4
[mysqld]
character-set-client-handshake=FALSE
character-set-server=utf8mb4
collation_server=utf8mb4_unicode_ci
[mysql]
default-character-set=utf8mb4
2.错误信息:
修改配置文件成功后,重启动数据库,但是重启动成功后,登录时出现如下错误信息,并直接退出
[mysql@localhost data1]$ mysql -p -S mysqldata1/sock/mysql.sockmysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
3.参考资料:
https://dev.mysql.com/doc/refman/5.5/en/charset-configuration.html
https://github.com/brianmario/mysql2/issues/3674.实施方法:
把配置文件/usr/share/mysql/charsets/Index.xml中的utf8编码改为utf8mb4即可,修改方法如下:[修改前:]
<charset name="utf8">
<family>Unicode</family>
<description>UTF-8 Unicode</description>
<alias>utf-8</alias>
<collation name="utf8_general_ci" id="33">
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="utf8_bin" id="83">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
[修改后:]
<charset name="utf8mb4">
<family>Unicode</family>
<description>UTF-8 Unicode</description>
<alias>utf-8</alias>
<collation name="utf8_general_ci" id="33">
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="utf8_bin" id="83">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
0 0
- mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/sha
- mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/sha
- mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/sha
- mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/s
- mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/s
- Character set 'utf8mb4' is not a compiled character set
- Character set 'utf-8' is not a compiled character set and is not specified
- 用innobackupex备份mysql提示 “utf8mb4 is not a compiled character set”?
- mysql登陆数据库的时候报错:mysql: Character set 'utf8' is not a compiled character set and is not specified
- Character set 'utf-8' is not a compiled character set and is not specifie
- Character set 'utf-8' is not a compiled character set and is not specifie
- COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
- [Sybase]Character set conversion is not available between client character set 'iso_1' and server character set 'cp936'.
- Unknown character set: 'utf8mb4' / mysql
- RMAN迁移之后问题character set name is not recognized
- NLS_LANG is not defined on the client.Character set conversion may cause unexpec
- NLS_LANG is not defined on the client.Character set conversion may cause unexpected results
- asp.net连接MYSQL出现Character set 'gbk' is not supported的解决方法
- codevs 1269 匈牙利游戏
- leetcode-226. Invert Binary Tree 二叉树、递归,交换两个变量的值
- Android Studio报错:Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version
- android 基础 serialization,Transient
- NewSQL数据库大对象块存储原理与应用
- mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/sha
- return语句的使用
- Maven项目报错
- 基础类库:StringBuffer、StringBuilder类
- Android怎么重新导入apache包?
- onload 与 ready 区别
- 子程序中的私有变量
- 四种途径将HTML5 web应用变成android应用
- javax.mail.AuthenticationFailedException:failed to connect的解决