選項(xiàng)default-charaset-set=utf8;
然后創(chuàng)建一個數(shù)據(jù)表 create table a_table(b varchar(255) not null);
insert into a_table values('北京');
這個時候插入的是中文,系統(tǒng)會報(bào)告錯誤:Incorrect string value: '\xB1\xB1\xBE\xA9' for column 'b' at;
這個不能插入中文。如果該語句寫在了一個文本文件中進(jìn)行批處理操作,保存的編碼是默認(rèn)的話也會出現(xiàn)這種的錯誤提示。
解決辦法:把文本文件存成utf-8格式的就可以正確執(zhí)行。