Springboot Project Connection Data error

Source: Internet
Author: User

Learn Springboot also not long, today Springboot connection database when reported the following error:

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) to use a more specifc Time zone value if you want to utilize time zone support.at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (SQLE rror.java:545) ~[mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (sqlerror.java:513) ~[mysql-connector-java-6.0.5.jar : 6.0.5]at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (sqlerror.java:505) ~[ Mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.exceptions.SQLError.createSQLException (Sqlerror.java : 479) ~[mysql-connector-java-6.0.5.jar:6.0.5]at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException ( sqlerror.java:489) ~[mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException (sqlexceptionsmapping.java:69) ~[mysql-connEctor-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.ConnectionImpl.createNewIO (connectionimpl.java:1606) ~[ Mysql-connector-java-6.0.5.jar:6.0.5]at com.mysql.cj.jdbc.connectionimpl.<init> (ConnectionImpl.java:633) ~ [Mysql-connector-java-6.0.5.jar:6.0.5]at com.mysql.cj.jdbc.ConnectionImpl.getInstance (connectionimpl.java:347) ~ [Mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.NonRegisteringDriver.connect ( nonregisteringdriver.java:219) ~[mysql-connector-java-6.0.5.jar:6.0.5]at Org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver (pooledconnection.java:310) ~[ Tomcat-jdbc-8.5.16.jar:na]at Org.apache.tomcat.jdbc.pool.PooledConnection.connect (pooledconnection.java:203) ~[ Tomcat-jdbc-8.5.16.jar:na]at Org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection (Connectionpool.java : 735) [Tomcat-jdbc-8.5.16.jar:na]at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection ( connectionpool.java:667) [Tomcat-jdbc-8.5.16.jar:na]at org.apache.tomcat.jdbc.pool.ConnectionPool.init (Connectionpool.java:482) [Tomcat-jdbc-8.5.16.jar:na]at org.apache.tomcat.jdbc.pool.connectionpool.<init> ( connectionpool.java:154) [Tomcat-jdbc-8.5.16.jar:na]at Org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool ( datasourceproxy.java:118) [Tomcat-jdbc-8.5.16.jar:na]at Org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool ( datasourceproxy.java:107) [Tomcat-jdbc-8.5.16.jar:na]at Org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection (datasourceproxy.java:131) [Tomcat-jdbc-8.5.16.jar:na] At Com.self.spring.springboot3.App.main (app.java:21) [classes/:na]caused by: Com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: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) to use a more specifc  Time zone value if you want to utilize time zone support.at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) ~[na:1.8.0_91]at sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:62) ~[na:1.8.0_91] At Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:45) ~[na : 1.8.0_91]at java.lang.reflect.Constructor.newInstance (constructor.java:423) ~[na:1.8.0_91]at Com.mysql.cj.core.exceptions.ExceptionFactory.createException (exceptionfactory.java:54) ~[ Mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.core.exceptions.ExceptionFactory.createException ( exceptionfactory.java:73) ~[mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone (timeutil.java:118) ~[mysql-connector-java-6.0.5.jar:6.0.5] At Com.mysql.cj.mysqla.MysqlaSession.configureTimezone (mysqlasession.java:293) ~[mysql-connector-java-6.0.5.jar : 6.0.5]at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer (connectionimpl.java:2399) ~[ Mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly (CONNECTIONIMPL.Java:1739) ~[mysql-connector-java-6.0.5.jar:6.0.5]at Com.mysql.cj.jdbc.ConnectionImpl.createNewIO ( connectionimpl.java:1596) ~[mysql-connector-java-6.0.5.jar:6.0.5] ... Common frames omitted

When we load the MySQL driver package with Mavean, we usually load it as follows:

        <Dependency>            <groupId>Mysql</groupId>            <Artifactid>Mysql-connector-java</Artifactid>            <version>6.0.5</version>        </Dependency>

But we use the Springboot framework to write programs that report errors, and there are hints in Pom.xml:

Solution: I removed the MySQL version number to run properly.

Springboot Project Connection Data error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.