ITPUX

. Ѷ .
Make progress together!
LinuxϵͳOracle11g R2 RAC װý̳
Oracleݿѵ-ݻָ-Ż-Ⱥ
OracleݿDBA߼ʦѵƵ
б

ΪʲôMySQLҪʹutf8mb4utf8

ݷluashin| ʱ䣺2017-6-8 06:54:20
ΪʲôMySQLҪʹutf8mb4utf8

һ
    MySQL5.5.3֮utf8mb4ı룬mb4most bytes 4˼רֽڵunicodeutf8mb4utf8ij˽Ϊutf8mb4ⲻҪתȻΪ˽ʡռ䣬һʹutf8Ҳ͹ˡ


    Ȼutf8ܹ´󲿷ĺ,ΪʲôҪʹutf8mb4? ԭMySQLֵ֧utf8ַΪ3ֽڣ4ֽڵĿַͻ쳣ֽڵUTF-8ܱUnicodeַ0xffffҲUnicodeеĻƽ(BMP)Ҳ˵κβڻıƽUnicodeַ޷ʹMySQLutf8ַ洢Emoji (EmojiһUnicode룬iosandroidֻ)ͺܶ಻õĺ֣ԼκUnicodeַȵȡ

Դ
    UTF-8ʽʹһֽڣܱ31λַµUTF-8淶ֻʹһĸֽڣܱ21λܹʾе17Unicodeƽ档
    utf8MySQLеһַֻ֧ֽڵUTF-8ַҲUnicodeеĻıƽ档
    MySQLеutf8Ϊʲôֳֻ֧ֽڵUTF-8ַأһ£ΪMySQLտʼᣬUnicodeûиƽһ˵ءʱUnicodeίԱỹš65535ַ㹻ȫˡΡMySQLеַַֽCHAR˵ҪΪַ㹻ijʹutf8ַʱҪijȾutf8ַȳַȣȻutf8󳤶Ϊ3CHAR(100)MySQLᱣ 300ֽڳȡںİ汾Ϊʲô4ֽڳȵUTF-8ַṩ֧֣һΪԵĿǣоǻƽַ֮ȷʵõ
    ҪMySQLб4ֽڳȵUTF-8ַҪʹutf8mb4ַֻ5.5.3汾ԺIJ֧(鿴汾 select version();)Ϊ˻ȡõļԣӦʹutf8mb4utf8CHARݣutf8mb4һЩռ䣬MySQLٷ飬ʹVARCHARCHAR



һƪ1MySQL 5.6Զװ
һƪMySQLͨ־
ظ

ʹõ ٱ

б
1

ֹ

ٻظ ض б