英文:
I cannot connect aws postgresql through my spring boot application
问题
我有一个正在进行中的购物应用项目。我下载了并使用了我本地创建的数据库。我们的老师要求我们使用AWS并连接到那里创建的数据库。我创建了数据库,但当我尝试通过IntelliJ IDE连接时遇到了下面的错误:
DBMS:PostgreSQL(无版本)
大小写敏感性:普通=混合,分隔=精确
连接尝试失败。
并且在错误下面显示了一个链接“指定版本”。当我点击它时,它要求我输入数据库版本。在课堂上,IntelliJ没有向我的老师显示这样的错误,我确保输入了正确的主机名、正确的数据库名称和密码。
我想这可能是因为在被要求使用AWS的PostgreSQL实例之前,我在同一个项目中本地使用了PostgreSQL。所以我更改了我的应用程序.yml文件中的数据源URL和密码,以期解决问题,但没有成功。
英文:
I have this ongoing shopping app project . I downloaded and I was using a database I created locally . Our teacher asked us to use aws and connect to a database we will create there . I created the database but I am encountering the error below when I try to connect to it through intellij ide :
DBMS: PostgreSQL (no ver.)
Case sensitivity: plain=mixed, delimited=exact
The connection attempt failed.
and it shows a link specify version
just below the error . When I click it , it asks me to enter database version . In class , intellij did not give an error like this to my teacher , and I am sure I`m entering the correct endpoint for hostname , correct db name and password .
I thought it might be because I was using postgres locally on the same project before we were asked to use a postgres instance from aws . So I changed my datasource url`s , passwords in my application.yml files thinking this might resolve the problem but it did not .
答案1
得分: 2
AWS Postgres是在设置RDS数据库时的一个选项。从Spring应用程序连接到RDS数据库是一个有效的用例。
要连接到RDS数据库,您必须为安全组设置一个入站规则,以允许从开发环境连接到数据库。设置入站规则实质上意味着启用一个IP地址来使用数据库。设置入站规则后,您可以从客户端(如MySQL Workbench)连接到数据库。有关更多信息,请参见使用安全组控制访问。
英文:
AWS Postgres is an option when you setup an RDS database. Connecting to an RDS database from a Spring app is a valid use case.
To connect to an RDS database, you must set up an inbound rule for the security group to connect to the database from your development environment. Setting up an inbound rule essentially means enabling an IP address to use the database. After you set up an inbound rule, you can connect to the database from a client such as MySQL Workbench. For more information, see Controlling Access with Security Groups.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论