New MySQL driver causes java.sql.SQLNonTransientCo

2019-03-29 01:24发布

If change MySQL JDBC driver from 5.1.38 to 6.0.2 I get the following exception

java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required

This exception was happened in normal JDBC initilization.

Probably, this can be related with SSL, since I get the following messages also

Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

which were absent in previous version.

4条回答
2楼-- · 2019-03-29 01:31

It seems new versions of mysql connector (from 6 on) are not compatible with old version of the DBMS mysql(below 5.6). So in order to solve your problem, if you make an update of mysql connector, try to do the same with the DBMS. Actually I had the same issu with mysql connector 8.0.13 and the DBMS msql 5.1.... I solved it by moving the DBMS to 5.6.17

查看更多
Luminary・发光体
3楼-- · 2019-03-29 01:38

I had the same issue and I resolved by changing the parent tag version from 2.1.1.RELEASE to 2.0.0.RELEASE

from

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

to

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
查看更多
放荡不羁爱自由
4楼-- · 2019-03-29 01:39

This sounds like a regression. Was there a particular reason to switch to 6.0.2? If not, I'd revert back to 5.1.38 and give 6.x a shot after three months to let folks at MySQL to stabilize the driver.

查看更多
beautiful°
5楼-- · 2019-03-29 01:44

I resolve this problem by removing mysql version in pom.

<dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>       
</dependency>   
查看更多
登录 后发表回答