duStar96

 

 解决方法:

将url改成:

jdbc:mysql://localhost:3306/studentmanage?useSSL=true&serverTimezone=Hongkong&characterEncoding=utf-8&autoReconnect=true

解析:

jdbc:mysql://是指JDBC的连接方式;

localhost:是指电脑的本地地址,等于127.0.0.1;

3306:SQL数据库的端口号;

studentmanage:指的是自己要连的数据库名字;

useSSL=true:

指的使用JDBC跟你的数据库连接的时候,你的JDBC版本与MYSQL版本不兼容,MYSQL版本更高一些,在连接语句后加上"useSSL=true",就可以连接数据库更高版本了

serverTimezone=Asia/Shanghai

用来指定时区,SpringBoot2.0如果不配置这个会报时区错误,我们指定的时区是香港(上海时区要放在连接的最末尾)

jdbc:mysql://localhost:3306/db16?useSSL=true&characterEncoding=utf-8&autoReconnect=true&serverTimezone=Asia/Shanghai

characterEncoding=utf-8&autoReconnect=true

用来指定编码格式为utf-8编码

 

分类:

技术点:

相关文章:

  • 2021-09-19
  • 2022-12-23
  • 2021-05-06
  • 2021-12-12
  • 2021-04-13
  • 2022-12-23
  • 2021-06-30
  • 2021-04-01
猜你喜欢
  • 2021-06-10
  • 2022-12-23
  • 2021-12-11
  • 2021-11-13
  • 2021-12-20
  • 2021-06-23
  • 2021-12-25
相关资源
相似解决方案