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
設置數據庫默認編碼為utf-8(在my.ini里面找到 default-character-set=utf8),然后在連接mysql和選擇了數據庫后要執行SET NAMES UTF-8
2017-01-02
數據庫、表 編碼問題
alter 一下,修改成統一的 utf8
就不會有問題了
2017-01-01
說錯了,是沒有報錯
2017-01-01
我這里測試了下,可以報你這個錯誤