com.mysql.cj.exceptions.InvalidConnectionAttributeException

版权声明:本文为博主原创文章,未经博主允许不得私自转载。 https://blog.csdn.net/QingHe97/article/details/90081173

报错:com.mysql.cj.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 property) to use a more specifc time zone value if you want to utilize time zone support.

原因及解决方案:
可能是使用了当前最新的mysql-connector-java MySQL驱动包,新的驱动包中com.mysql.jdbc.Driver类已经过时,新的是:com.mysql.cj.jdbc.Driver通过SPI自动注册,不再需要手动加载驱动类,把版本换低一点就好了

猜你喜欢

转载自blog.csdn.net/QingHe97/article/details/90081173