Mysql——Springboot插入mysql中的中文數據變成??:
網上有很多解決方案,但是我的解決方案就是
jdbc:mysql://localhost:3306/SpringBootSystem?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
需要把amp;
去掉後:
jdbc:mysql://localhost:3306/SpringBootSystem?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
後數據插入正常!
注:你在 xml 配置文件中配置應當寫上amp;
,但是當你在yml文件中配置的時候,就應該去掉amp;
。