1. 检查建表的时候是否指定编码类型,如:
CREATE TABLE IF NOT EXISTS `ttt`( `id` INT UNSIGNED AUTO_INCREMENT, `name` VARCHAr(100) NOT NULL, PRIMARY KEY ( `id` ) )ENGINE=InnoDB DEFAULT CHARSET=utf8;
2. 检查application.properties配置文件知否指定连接utf-8:
spring.datasource.driverClassName=org.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8 spring.datasource.username=root spring.datasource.password=123456
3. 检查存储过程的入参是否加入“ CHARACTER SET utf8”指定utf-8的编码类型:
delimiter $$ create procedure insertKj(in myname varchar(100) CHARACTER SET utf8 , out id int) begin insert into ttt(name) VALUES(myname); select LAST_INSERT_ID() into kj_tbl_id; end $$



