spring boot 操作数据库,出现乱码解决方法:

在配置数据库地址的代码后加上:?useUnicode=true&characterEncoding=UTF-8

   如jdbc.properties配置文件:

   db.url=jdbc:mysql://localhost:3306/database?useUnicode=true&characterEncoding=UTF-8

如下图所示:

spring boot 操作数据库出现乱码解决方案

   注意:后面“?”之后的代码一定要有的。


相关文章:

  • 2021-06-25
  • 2022-02-07
  • 2021-06-04
  • 2021-12-03
  • 2021-12-03
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2021-12-30
  • 2021-05-08
  • 2022-01-02
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
相关资源
相似解决方案