首页 > 解决方案 > AWS RDS Mysql 社区 - 春季启动

问题描述

有没有人将本地运行的 Spring Boot 应用程序连接到 AWS RDS Mysql 社区(免费层)版本。我已经通过指定尝试了通常的方法:

spring:
  datasource:
    url: jdbc:mysql://<endpoint as shown on the amazon DB details page.amazonaws.com>:3306
    username: <user>
    password: <password>
    initialization-mode: always

这会在春季引发异常

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

我已经在 POM 中包含了 mysql 驱动程序

<dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

任何人有任何线索?哦,是的,我在 aws 上为数据库实例选择了“允许访问公共”,还添加了一个选择 http-custom-anywhere 的安全配置文件

入站规则 aws 的屏幕截图: 在此处输入图像描述

出站规则: 在此处输入图像描述 谢谢,

标签: mysqlamazon-web-servicesspring-boot

解决方案


出站规则错误。

它应该是 :

在此处输入图像描述


推荐阅读