Article directory
Preface
- There are a lot of things going on recently, I envy the little guy who just started, he is carefree, I really don’t recommend non-scientific exams, it’s too difficult... That’s how it is, I recently brought the newcomers here to upgrade the old projects , and then, because it is the decompiled source code, and the data source server has been withdrawn, it can only be built and run locally, and then there is a problem with the Mysql-connector-java driver version.
- The database version is version 5.7, the old project is 5.5, and then an error is reported
Mysql-connector-java driver version
com.mysql.jdbc.Driver 是 mysql-connector-java 5中的,
com.mysql.cj.jdbc.Driver 是 mysql-connector-java 6中的
- If not explicitly set, MySQL versions 5.5.45+, 5.6.26+ and 5.7.6+ require an SSL connection by default. It is not recommended to establish SSL connections without server authentication.
- If you do not need to use SSL connections, you need to explicitly disable SSL connections by setting useSSL=false.
mysql-connector-java and Mysql corresponding version
driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/数据库名?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false
username=root
password=
The serverTimezone here must be written as serverTimezone=Asia/Shanghai, and it will also report an error when written as serverTimezone=Shanghai. It seems that the time zone of shanghai cannot be found.