GithubHelp home page GithubHelp logo

dalian369 / dalian369.github.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wqbin/wqbin.github.io

0.0 0.0 0.0 1.98 MB

DaLian369个人博客

Home Page: http://DaLian369.github.io

License: MIT License

HTML 34.53% CSS 44.52% JavaScript 20.94%

dalian369.github.io's People

Contributors

dalian369 avatar wqbin avatar

dalian369.github.io's Issues

java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ 解决方案

//第一个异常

Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

意思是 mysqljdbc . driver被弃用了新的驱动类是“com.mysql.cjdbc.driver”。驱动程序通过SPI自动注册,而手动加载类通常是不必要的,解决方案如下:

//解决方法
把com.mysql.jdbc.Driver 改为com.mysql.cj.jdbc.Driver 即可

//第二个异常

java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time

提示系统时区出现错误,可以在mysql中执行命令:
set global time_zone='+8:00'
或者在数据库驱动的url后加上serverTimezone=UTC参数

写代码的时候要注意,如果该参数是‘?’后的第一个,即

jdbc:mysql://localhost:3306/exam?serverTimezone=UTC

是没有问题的,但如果不是第一个,即

jdbc:mysql://localhost:3306/exam?characterEncoding=utf8&serverTimezone=UTC

这种写法是会报错的,会提示The reference to entity “serverTimezone” must end with the ‘;’ delimiter.
运行后控制台也会出现
对实体 “serverTimezone” 的引用必须以 ‘;’ 分隔符结尾。
的错误提示。
将代码改为

jdbc:mysql://localhost:3306/exam?characterEncoding=utf8&serverTimezone=UTC

即可。在xml的配置文件中 ;要用 & 代替。

最后我是在mysql中执行命令: set global time_zone='+8:00' ,解决问题的。
在url后面加参数都不行。。。

转自https://www.cnblogs.com/cn-chy-com/p/10145690.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.