1)表1和表2的产品名称[数据库字段]字符编译方式不一致
①问题
org.springframework.jdbc.UncategorizedSQLException:
Error updating database. Cause: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x8E\x81\xE7\x88...' for column 'product_name' at row 41
The error may involve com.bessky.financial.mapper.business.financereport.systemanalyze.AccountSkuShipmentRefundMapper.insertOrUpdateBatch-Inline
The error occurred while setting parameters
; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x8E\x81\xE7\x88...' for column 'product_name' at row 41; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x8E\x81\xE7\x88...' for column 'product_name' at row 41
②原因
产品表和账号&sku退款率发货月的产品名称[数据库字段]字符编译方式不一致
-
表1是:utf8mb4
-
表2是:utf8
③解决思路
修改表2的产品名称字段字符集以及排序规则
因为这里表2是接收方,数据主要是从表1写入到这个表2中的
④解决方案
ALTER TABLE `account_sku`
MODIFY COLUMN `product_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品名称';
- 问题 39 SQLException product_name Incorrect问题39 sqlexception product_name sqlexception incorrect xf0 x9f 39 sqlexception localhost password 39 incorrect nick_name string 39 truncation incorrect mybatis business_license_url 39 incorrect business 39 default sqlexception field incorrect sqlstate general问题 incorrect string问题value product_name