关于idea插入数据到数据库变问号的问题

工具版本:

idea 2019.3.5

mysql 5.7.27

连接的url为:

当插入语句中含有 中文字符时,在数据库中会变为???

解决办法:

  url: jdbc:mysql://localhost:3306/maoyanmovie?serverTimezone=UTC

把上面的url改为如下代码

url: jdbc:mysql://localhost:3306/maoyanmovie?useSSL=true&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai

现在再次插入就好了

原文地址:https://www.cnblogs.com/cleanlife/p/14109818.html