JDBC报错 消息 Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable 'tx_isolation'

After today with JDBCTemplate, I found that starting the server error:  Could not GET JDBC Connection; nested Exception IS java.sql.SQLException: Unknown System variable 'TX_ISOLATION' .

MySQL version of the Internet that is too high because of a problem with my MySQL version 8.0, which has no tx_isolation, became transaction_isolation, with the following solutions:

(1) Change the MySQL

 

 Invalid, still error!

(2) the mysql-connector-java upgraded to match with MySQL version 8.0 and above

To solve a problem, but a new problem has emerged:

java.sql.SQLException: The server time zone value  '�й���׼ʱ��' is unrecognized or represents more than...

 This error is due to dependencies mysql connection is the high version, not simply when configuring datasource.url such feature:

url=jdbc:mysql://localhost:3306/day13

We need to add some necessary information suffix (into the following configuration on it):

url=jdbc:mysql://localhost:3306/day13?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

ok, problem solved!

Guess you like

Origin www.cnblogs.com/iceywu/p/12188930.html