zoukankan      html  css  js  c++  java
  • JDBC连接时出现的问题总结

    java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

    原因:time zone 时区错误

    解决方法:

    一:通过sql命令临时修改,这个只是临时方法,关闭mysql服务后重启又恢复系统默认时区

      1.使用root用户登录mysql,输入下面命令。      

    show variables like '%time_zone%';

      2.SYSTEM为SQL默认美国时间,因此将时区设置为当前系统时区即可,采用+8:00格式

    set global time_zone='+8:00';

    二:给连接数据库url添加serverTimezone=UTC语句

    jdbc_url=jdbc:mysql://localhost:3306/login?serverTimezone=UTC
  • 相关阅读:
    维度穿梭
    演绎与抽象
    幻想的功能
    深层探宝
    内存游戏
    函数内功
    共享与私有的变量
    参数的格式
    功能模拟与功能实现
    【Oracle】基础知识查漏补缺
  • 原文地址:https://www.cnblogs.com/chaoyang123/p/11549853.html
Copyright © 2011-2022 走看看