【发布时间】:2019-03-03 22:44:48
【问题描述】:
我收到以下错误。
java.sql.SQLException: Access denied for user 'aravind'@'192.168.99.1' (using password: YES)
但在我的 application.prpoerties 中,我指定了以下属性
spring.datasource.url=jdbc:mysql://192.168.99.100:3306
spring.datasource.username=aravind
spring.datasource.password=aravind
spring.datasource.name=zeus_spring
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
server.port=8090
Spring boot 删除了最后两个零,我不知道为什么。我有一个可以通过该 IP 访问的 docker 容器。
【问题讨论】:
-
可能只是控制台日志的 ip 被截断了。它实际上不会尝试访问截断的 ip,因为否则它不会说访问被拒绝。由于日志显示拒绝访问,这意味着它正在尝试连接到正确的 IP。只是提供的凭据未通过身份验证。
-
你能分别用这些凭据连接到mysql实例吗?
标签: mysql spring docker spring-boot