关于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

 

现在再次插入就好了

 

posted @ 2020-12-09 17:21  安逸的坐姿  阅读(556)  评论(0编辑  收藏  举报