mysql使用utf8mb4经验吐血总结

1. utf8 与 utf8mb4 异同 先看 官方手册 https://dev.mysql.com/doc/refman/5.6/en/charset-unicode-utf8mb4.html 的说明: 1 2 3 4 The character set named utf8 uses a maximum of three bytes per character and contains only BMP characters. The utf8mb4 character set uses a maximum of four bytes per character supports supplementary characters: - For a BMP character, utf8 and utf8mb4 have identical storage characteristics: same code values, same encoding, same length. - For a supplementary character, utf8 cannot store the character at all, whereas utf8mb4 requires four bytes to store it. Because utf8 cannot store the character at all, you have no supplementary characters in utf8 columns and need not worry about converting characters or losing data when upgrading utf8 data from older versions of MySQL. MySQL在 5.5.3 之后增加了 utf8mb4 字符编码,mb4即 most bytes 4。简单说 utf8mb4 是 utf8 的超集并完全兼容utf8,能够用四个字节存储更多的字符。 ...

2016-10-23 · 7 min

mysql使用utf8mb4经验吐血总结

1. utf8 与 utf8mb4 异同 先看 官方手册 https://dev.mysql.com/doc/refman/5.6/en/charset-unicode-utf8mb4.html 的说明: 1 2 3 4 The character set named utf8 uses a maximum of three bytes per character and contains only BMP characters. The utf8mb4 character set uses a maximum of four bytes per character supports supplementary characters: - For a BMP character, utf8 and utf8mb4 have identical storage characteristics: same code values, same encoding, same length. - For a supplementary character, utf8 cannot store the character at all, whereas utf8mb4 requires four bytes to store it. Because utf8 cannot store the character at all, you have no supplementary characters in utf8 columns and need not worry about converting characters or losing data when upgrading utf8 data from older versions of MySQL. MySQL在 5.5.3 之后增加了 utf8mb4 字符编码,mb4即 most bytes 4。简单说 utf8mb4 是 utf8 的超集并完全兼容utf8,能够用四个字节存储更多的字符。 ...

2016-10-23 · 7 min

遇到腾讯云CDB连接字符集设置一个坑

最近一个与qq有关的服务迁到腾讯云上,相应的数据库也要从原阿里云RDS迁移到腾讯云CDB上,经过一番摸索,不带任何政治色彩的说,CDB跟RDS相比弱的不止一条街。比如看个错误日志还要提工单,数据库访问没有白名单,数据传输服务竞不支持源库的开启GTID,自带的后台管理是phpMyAdmin,要临时看查询日志也要提工单,当然这些都是可以容忍通过其它方法解决的,但是如果使用上带来了mysql数据库本身的影响,就用的不太爽了。 ...

2016-10-17 · 3 min

遇到腾讯云CDB连接字符集设置一个坑

最近一个与qq有关的服务迁到腾讯云上,相应的数据库也要从原阿里云RDS迁移到腾讯云CDB上,经过一番摸索,不带任何政治色彩的说,CDB跟RDS相比弱的不止一条街。比如看个错误日志还要提工单,数据库访问没有白名单,数据传输服务竞不支持源库的开启GTID,自带的后台管理是phpMyAdmin,要临时看查询日志也要提工单,当然这些都是可以容忍通过其它方法解决的,但是如果使用上带来了mysql数据库本身的影响,就用的不太爽了。 ...

2016-10-17 · 3 min