简体   繁体   中英

Amazon RDS postgres Data wiped and can't connect to database?

I created an RDS Postgres instance. I'm new to RDS.

db host:

 demodb.xxxuxxvxxxxx.us-east-2.rds.amazonaws.com

db identifier:

demodb

Every tutorial says to connect with this URL: jdbc:postgresql://demodb.xxxuxxvxxxxx.us-east-2.rds.amazonaws.com:5432/demodb

but every time I do I get this error-

FATAl: database "demodb" does not exist.

I am able to connect using this:

 jdbc:postgresql://demodb.xxxuxxvxxxxx.us-east-2.rds.amazonaws.com:5432/postgres

Now, while I was excited to connect after I used SQL workbench to create tables and insert data into those tables, a few hours later all my tables and data were deleted/wiped/dropped. Why would this happen? and How can I prevent it from happening in the future?

FATAl: database "demodb" does not exist.

demodb is db instance identifier. It is NOT the name of your database inside of PostgreSQL.

By default RDS PostgreSQL does not create a database for you . It seems to me that you haven't created an actual database when you setup your RDS PostgreSQL.

To create a database at RDS creation there is an option called Initial database name where you should specify the name of the database you want. Otherwise, no database is created, which is a default behavior :

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM