mysql - SpringBoot 截断连接 url 中的最后两个字符
问题描述
我收到以下错误。
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 容器。
解决方案
使用以下属性并删除数据源名称应该可以。
spring.datasource.url=jdbc:mysql://192.168.99.100:3306/zeus_spring
推荐阅读
- python-3.x - Django 3 Python 3.8 whitenoise 不服务 request.user
- python - scipy gaussian_kde 根据使用的方法产生不同的结果(权重与无权重)
- javascript - 我可以在 Keycloak 注册页面上加载已经写好的电子邮件吗?
- php - 尝试在使用会话变量时获取非对象的属性“页面”
- angular - 无法在角度应用程序中打开受密码保护的 pdf
- python - 多个输出的 Keras 指标
- java - 将唯一的密钥火力库保存给孩子
- c++ - 为什么循环在第一次迭代中跳过输入?
- r - 我在尝试使用 scale_y_datetime not show geom_bar 时遇到了很多麻烦
- swift - 请解释与 swiftui 结合的奇怪行为