首页 > 编程知识 正文

设置数据库字符集为utf8,mysql字符集utf8mb4

时间:2023-05-05 15:49:07 阅读:120782 作者:2960

iknowthatmysqlhasdefaultoflatin1encodingandapparentlyittakes1bytetostoreacharacterinlatin1and3bytestostoreacharacterinutf-8

iamworkingonasitethatihopewillbeusedglobally.doiabsolutelyneedtohaveutf-8? orwillibeabletogetawaywithusinglatin 1?

Also,itriedtochangesometablesfromlatin1to utf8 butigotthiserror :

doesanyoneknowthesolutiontothis? andshouldireallysolvethatormaylatin1be enough?

Thanks,

klddw/p

it takes1bytestostorealatin1character and1 to3bytestostoreazjdbbzcharacter。

ifyouonlyusebasiclatincharactersandpunctuationinyourstrings (0to 128 in unicode ),bothcharsetswillocccupythesamelength。

Also,itriedtochangesometablesfromlatin1to utf8 butigotthiserror 3360 ' speficiefkeywastoolong; maxkeylengthis 1000 bytes ' doesanyoneknowthesolutiontothis? andshouldireallysolvethatormaylatin1be enough?

ifyouhaveacolumnofvarchar(334 ) or longer,myisam wont ' tletyoucreateanindexonitsincethereisremoteposibilityofthecolumntochochontochonther

notethatkeysofsuchlengtharerarelyuseful.youcancreateaprefixedindexwhichwillbealmostasselectiveforanyreal-world数据。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。