Incorrect string value: '\xE4\xB8\xAD\xE7\xBA\xA7' for column 'title' at row 1

时间:2022-10-29 17:08:57

运行hibernate,向数据库插入中文时出现错误:Incorrect string value: '\xE4\xB8\xAD\xE7\xBA\xA7' for column 'title' at row 1


原因是数据库表中title字段的字符集设定错误,一般改为utf8_general_ci就可以了。