JDBC connection problems when summary

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.

The reason: time zone time zone errors

Solution:

A: The sql command temporary modifications, this is only temporary, turn off the restart and restore the system default after mysql service area

  1. logged in as root mysql, enter the following command.      

show variables like '%time_zone%';

  2.SYSTEM for SQL default American time, so the time zone to time zone to the current system, the use of +8: 00 Format

set global time_zone='+8:00';

Two: to connect to the database url added serverTimezone=UTCstatement

jdbc_url=jdbc:mysql://localhost:3306/login?serverTimezone=UTC

 

Guess you like

Origin www.cnblogs.com/jiaqi-qiu/p/JDBC.html