解決 SpringBoot 插入數據到 MySQL 中文亂碼問題

檢查配置文件dbconfig.properties 編碼集是否爲utf8

spring.datasource.url=jdbc:mysql://xxx.xxx.xxx.xxx/test?useUnicode=true

spring.datasource.url=jdbc:mysql://xxx.xxx.xxx.xxx/test?useUnicode=true&usessl=false&characterEncoding=utf8
spring.datasource.username=
spring.datasource.password=**

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章