8.0以后的mysql很强大,但是配置写法出现了不同

主要原因是时区不同,mysql默认用的是国外某个地方的时区,而我们要用的话用使用东八时区,这是中国统一时区。

装载自https://blog.csdn.net/sunshunli/article/details/104360356

 

spring中xml配置文件写法:

<property name="driverClassName" value="com.mysql.cj.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost:3306/数据库名称?characterEncoding=utf8&useSSL=true&serverTimezone=GMT%2B8"></property>





 

  

new 对象

jdbc:mysql://localhost:3306/数据库名称?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false






 

相关文章:

  • 2021-08-26
  • 2021-12-08
  • 2021-10-13
  • 2022-12-23
  • 2021-12-24
  • 2021-09-13
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2021-10-23
  • 2022-12-23
  • 2021-10-19
  • 2021-06-09
  • 2022-12-23
  • 2021-07-11
  • 2021-04-17
相关资源
相似解决方案