Mysql cov ntaub ntawv tswj kev tswj hwm, pib txij version 4.1, txhawb nqa ua haujlwm nrog encodings. Cov teeb meem tseem ceeb nrog lawv tshwm sim thaum sib txuas nrog cov ntawv sau nrog Php. Hauv qhov no, qhov tseem ceeb ntawm cov ntsiab lus ntawm lub hauv paus thiab qhov txuas yuav tsum sib phim.
Cov Lus Qhia
Kauj ruam 1
Nco ntsoov tias ib qho teeb meem tshwm sim uas muaj teeb meem nrog Mysql yog tias lub neej ntawd encoding rau databases tau teeb tsa rau latin1. Feem ntau ntawm cov neeg txuas nrog kuj tau teeb tsa rau nws, koj nkag mus rau cov ntaub ntawv thiab saib cov txiaj ntsig siv nws ib yam nkaus. Txawm hais tias qhov cim sau no qhia cov npe ntawv Cyrillic tseeb, cov lej cim ntawm lub rooj cim hauv nws tsis raug rau cov cim Cyrillic tseeb. Yog li, kev tshawb fawb thiab xaiv cov ntaub ntawv tuaj yeem ua tiav cov txiaj ntsig tsis muaj dab tsi tshwm sim.
Kauj ruam 2
Hloov cov ntaub ntawv rau lub hauv paus rau ib qho uas qhia cov cim Cyrillic, piv txwv li, utf-8 lossis cp1251. Txhawm rau ua qhov no, hloov cov ntaub ntawv los ntawm Latin1 encoding mus rau cp1251. Tsis txhob siv cov ntaub ntawv hloov pauv yooj yim, vim tus cim tsis raug. Yog li ntawd, koj yuav tsum tau tshem ntawm lawv cov encoding kev khi. Ua li no, hloov cov ntaub ntawv thiab hom cim rau hauv cov ntaub ntawv binary. Siv cov lus nug Alter table "Sau lub npe lub npe" t1 hloov c1 c1 blob.
Kauj ruam 3
Khiav cov lus nug los hloov qhov encoding ntawm Mysql database, rau qhov no siv ua piv txwv hauv qab no: Alter table "Sau lub npe npe" t1 hloov c1 c1 ntawv sib tham kab lus "Sau lub npe ntawm qhov xav tau encoding, piv txwv li, cp1251". Tsis yog ib byte ntawm cov ntaub ntawv tau hloov lub cev, tab sis txoj cai ntawm kev ua cov cim pauv. Tom qab, txhawm rau hloov cov ntaub ntawv encryption, koj tuaj yeem siv cov lus nug hloov ntaub ntawv yooj yim.
Kauj ruam 4
Thov nco ntsoov tias thaum hloov cov lus encodings hauv ib daim teb uas muaj cov cim qhia, koj yuav tsum rho tawm lawv thiab rov ua kom zoo, i.e. rov tsim dua hauv txhua cov ntxhuav database. Thaum hloov mus rau encoding, ua kom pom tseeb cov neeg siv khoom txhawb nqa unicode. Piv txwv li, SQLyog tus neeg siv khoom tsis raug qhia cov ncauj lus ntawm cov ntxhuav uas khaws cov ntaub ntawv hauv utf-8 encoding.