/usr/share/mysql/_Can't initialize character set utf8 (path: /usr/share/mysql/charsets/)

【1】Can't initialize character set utf8] (path: /usr/share/mysql/charsets/)

【1.1】

报错信息:

mysql: Character set 'utf8]' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file

mysql: Character set 'utf8]' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file

ERROR 2019 (HY000): Can't initialize character set utf8] (path: /usr/share/mysql/charsets/)

【1.2】验证文件字符集,验证mysql支持的字符集;

查看字符串是否是mysql支持的,比如把文件放到notpad++中去查看。

或者进入mysql,查看Mysql支持的字符集有哪些(show charset;)

文件字符集:

【1.3】usr/share/mysql/charsets/Index.xml

文件:usr/share/mysql/charsets/Index.xml ,看这个文件好像并没有什么卵用。

一看就知道,无法识别解析字符,看看配置文件

【1.4】my.cnf

果然,客户端字符集设置有问题,修改好后,解决问题。

这里因为是 [client]的问题,所以不需要重启mysql,大家可以试试,实在不行再重启 Mysql。

【2】Character set 'utf-8' is not a compiled character set and is not specified

当出现“Character set 'utf-8' is not a compiled character set and is not specifie”的错误时,

将mysql安装目录下的my.ini文件的default-character-set=utf-8更改为default-character-set=utf8即可,

简单来说就是将"utf-8"更改为"utf8"即可。

【3】Mysql:Character set 'utf8mb4' is not a compiled character set ... 解决方案

连接Mysql时出现如下错误

Mysql:Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file

解决方法如下:

打开文件/usr/share/mysql/charsets/Index.xml

直接复制文件中utf8的配置,改为utf8mb4后,添加到文件中故障解决,更改方式如下

Unicode

UTF-8 Unicode

utf-8

primary

compiled

binary

compiled

参考文件

字符集问题:https://blog.csdn.net/ACMAIN_CHM/article/details/4174186

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值