设置了编码格式后还是不行
HTTP Status 500 - Hibernate operation: could not insert: [cn.itcast.shop.product.vo.Product]; uncategorized SQLException for SQL [insert into product (pname, market_price, shop_price, realname , pdesc, is_hot, pdate, csid) values (?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: ‘\xE7\x99\xBB\xE9\x99\x86…’ for column ‘image’ at row 1; nested exception is java.sql.SQLException: Incorrect string value: ‘\xE7\x99\xBB\xE9\x99\x86…’ for column 'realname ’ at row 1
这样修改了一下可以了
alter table tb_user modify realname varchar(255) charset utf8 collate utf8_general_ci;