java程序向mysql添加中文数据时发生异常:java.sql.SQLException: Incorrect string value: '\xE6\x9D\x8E\xE5\x87\xA4'
检查mysql数据库的库、表、字段编码
- 库的collation编码
- 表的collation编码
- 字段的collation编码
三个地方编码要统一使用utf8,批量修改字段编码的sql语句:
alter table `表名` convert to charset utf8;
检查mysql数据库的库、表、字段编码
alter table `表名` convert to charset utf8;