【发布时间】:2019-06-08 05:37:52
【问题描述】:
我正在尝试使用 springboot 连接数据库,但它没有以任何方式运行。到目前为止,我已经提出了大约 3 个应用程序,但都有相同的问题。我是一个春天的新手,第一次工作。
我在应用程序中使用了 JPA 和 Mysql,但始终会出现错误。
申请文件
datasource:
url: jdbc:mysql://localhost:3306/test_schema
username: root
password: user
jpa:
generate-ddl: true
show-sql: true
错误
Sat Jun 08 11:02:13 IST 2019 WARN: 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.
2019-06-08 11:02:13.362 ERROR 14040 --- [ main] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool.
java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:868) ~[mysql-connector-java-5.1.41.jar:5.1.41]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:864) ~[mysql-connector-java-5.1.41.jar:5.1.41]
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1746) ~[mysql-connector-java-5.1.41.jar:5.1.41]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226) ~[mysql-connector-java-5.1.41.jar:5.1.41]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2205) ~[mysql-connector-java-5.1.41.jar:5.1.41]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2236) ~[mysql-connecto......
Error continues and is really a very long list
我之前问过一个类似的问题,但解决了数据库模式和表的问题,但现在出现了。几乎所有应用程序都显示此错误。 Mysql 已启动并正在运行。用户名密码正确。数据库也有一些初始条目。
【问题讨论】:
-
你能登录mysql吗?
mysql -uroot -puser或telnet 127.0.0.1 3306端口是否开放?需要更多信息。 -
@jin 是打开的。顺便说一句,下面的答案解决了上述错误,但现在出现了一个新错误。 java.sql.SQLException: 未知系统变量 'query_cache_size'
标签: java mysql spring spring-boot jpa