mysql插入漢子失敗
root@localhost ttt>create table ce(
? ? -> username varchar(25)
? ? -> )
? ? -> ENGINE= MYISAM CHARACTER SET utf8 ;
Query OK, 0 rows affected (0.02 sec)
root@localhost ttt>insert into ce(username) value('張');
ERROR 1366 (HY000): Incorrect string value: '\xD5\xC5' for column 'username' at row 1
2017-01-02
設(shè)置數(shù)據(jù)庫默認(rèn)編碼為utf-8(在my.ini里面找到 default-character-set=utf8),然后在連接mysql和選擇了數(shù)據(jù)庫后要執(zhí)行SET NAMES UTF-8
2017-01-02
數(shù)據(jù)庫、表 編碼問題
alter 一下,修改成統(tǒng)一的 utf8
就不會有問題了
2017-01-01
說錯了,是沒有報錯
2017-01-01
我這里測試了下,可以報你這個錯誤