严重: create connection SQLException, url: jdbc:mysql://localhost:3306/mm, errorCode 1251, state 08004
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not suppor
首先将url改成
<property name="url" value="jdbc:mysql://localhost:3306/mm?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC" />
依然报错
create connection SQLException, url: jdbc:mysql://localhost:3306/mm?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC, errorCode 1251, state 08004
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
后来发现是mysql-connect的jar包版本不对,我连接的mysql数据库是8.0版本的
然而使用的jar包是5.0版本的。将mysql-connect的jar包版本改为8.0即可文章来源:https://www.toymoban.com/news/detail-763784.html
文章来源地址https://www.toymoban.com/news/detail-763784.html
到了这里,关于Spring报错:create connection SQLException, url: jdbc:mysql://localhost:3306/mm, errorCode 1251, state的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!