当前位置: 代码迷 >> 综合 >> 数据库连接失败java.sql.SQLException: The server time zone value
  详细解决方案

数据库连接失败java.sql.SQLException: The server time zone value

热度:85   发布时间:2024-01-31 20:52:25.0

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.

 

解决办法:

 

修改数据库时区:

##修改mysql全局时区为北京时间,东8区

 set global time_zone = '+8:00'; 

##修改当前会话时区

 set time_zone = '+8:00';

  flush privileges; #立即生效