【发布时间】:2018-08-19 07:45:58
【问题描述】:
我有一个使用 SSL + 证书安全运行的远程 Mysql 服务器。我可以使用自制的密钥库和 truststore.jks 使独立的 Java JDBC 连接正常工作。问题是我找不到任何说明如何将使用 SSL + 证书保护的 mysql 数据库插入 springboot 的文档或网站。我的 application.properties 文件有这个:
spring.jpa.database=MYSQL
spring.datasource.url=jdbc:mysql://{remote-ip}:3306/{database-name}?verifyServerCertificate=true&useSSL=true&requireSSL=true
spring.datasource.username=xxxxxxxx
spring.datasource.password=xxxxxx
spring.jpa.show-sql=true
在 Eclipse 中,我在 JVM-arguments 字段下有:
-Djavax.net.ssl.trustStore="{path}\truststore.jks" -Djavax.net.ssl.trustStorePassword="xxxxx" -Djavax.net.debug=ssl
-Djavax..net.ssl.keyStore="{path}\keystore"
-Djavax.net.ssl.keyStorePassword="xxxxx"
这行不通。给我这个错误:
java.sql.SQLException: Access denied for user '{database-user}'@'{remote-ip}' (using password: YES)
【问题讨论】:
标签: mysql spring-boot