• 原因是springboot配置文件(application.properties/application.yml)中的数据库配置没有加上指定编码

  • 由spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2B8

  • 改为
    spring.datasource.url=jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8&useUnicode=true&serverTimezone=GMT%2B8&allowMultiQueries=true

Q.E.D.


No Pain,No Gain~