問題:
** MySQL Workbench 中錯(cuò)誤提示:**1366 Incorrect string value: '\xE5\xBC\xA0\xE4\xB8\x89' for column 'sname' at row 1
解決方法:
查看數(shù)據(jù)庫、表、中文列、連接 url,把所有字符集統(tǒng)一為 UTF8,即解決中文插入報(bào)錯(cuò)問題。
# 查看數(shù)據(jù)庫字符集
show create database imooc_sh;
# 查看數(shù)據(jù)表字符集
show create table students;
# 查看表中列字符集,如下圖:

Workbench 中查看與修改字符集
注:此問題通常會(huì)出現(xiàn)在如 Hibernate 生成表結(jié)構(gòu)等。
參考鏈接:http://blog.csdn.net/hongweigg/article/details/46354647