How can I change the "Database Name" in AWS RDS for Postgresql?
Asked Answered
N

5

30

I wanted to create a replicate of my production database for staging and created the staging DB instance from a production snapshot. However, this new instance still has the Database Name: "production-database". I was able to rename the database on PSQl to "staging-databse," but this is not reflected in the AWS Console. I'm afraid that future developers will be very confused, and was wonderign how to rename the "Database Name" on AWS?

Nephro answered 29/3, 2017 at 16:28 Comment(3)
I'd recommend not using automatic database creation from console. It's better to login just after creating to a standard postgres database and use create database dbname. This won't help you in this issue though.Eating
How do you login though? If DB is private and not accessible from outside of VPCEvangelista
This is latest, but check if your db instance is eligible for what you are trying to achieve using Amazon RDS Blue/Green Deployments: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/…Emery
G
42

Not immediately obvious - when creating a new db expand the Additional Configuration card to create an initial db name

Addtional Configuration

Gotthelf answered 10/4, 2021 at 0:39 Comment(5)
This is stupid!Pauly
you're kidding me right, I had to delete and recreate the DB,...Agle
we all have to come here at some point, tbh ! hahaha like i am doing today. for sth so important as Initial DB Name, how they decided to put that on the dead end of the config process. tf!!Giddens
This is ridiculous, you saved me here but could not believe this when I saw it.Artie
Indeed me too, didn't see how to fix this in the documentation. Glad I saw this postCauliflower
C
33

I created a new free tier instance for small scale testing and this is the DB name I see in my configuration:

enter image description here

I looked everywhere, but could not figure out what my database name is or how to create an initial database. Turns out the database name is postgres. It's also worth noting that I kept the default username, so in this case the username and database name are the same. If you changed the default username and postgres isn't working, maybe try using your username as your database name.

Cassondra answered 1/5, 2022 at 20:35 Comment(2)
Great point about the free tier. It looks like you may not have an option to change the name. The line shown in @nakulthebuilder's answer doesn't exist for my free tier db.Gush
I just started the free tier and I DO see the config option from @nakulthebuilder's answer. Note you need to click the little arrow to expand the pane. Stupidly hidden.Glaser
E
26

Don't use the default database option. All it does is create a custom-named database by default. There may be uses for it, but I never use it, because it seems to serve no purpose at all other than to specify what the database that's created by default (when the instance is first created) will be named.

Database Name

If you want to specify a database name for the default database, type a name for your database of up to 63 alpha-numeric characters. If you do not provide a name, the default "postgres" database is created.

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreatePostgreSQLInstance.html

I assume this is intended to be a convenience for new RDS users, but to me, it seems unnecessary. It has no apparent impact on ongoing operation of the instance, which can, of course, have multiple independent databases on it.

This apparently can't subsequently be changed, so it's more of an annoyance than anything. I always leave this blank.

Egidius answered 30/3, 2017 at 0:29 Comment(5)
so what is the default database name then? I forgot what I set mine too and RDS panel won't let me see it.Contrapuntist
Log into the actual database instance you created. If you didn't specify one, there should be one called "postgres" but you can create whatever you want, once you've logged in.Egidius
I found the DB name in the Configuration tab of my database cluster in the web console.Psychologism
I don't see any DB name in the config tab.Centipede
Has anyone seen it? still cant find it neither @RyanR in the config I cant even see clusterTillman
A
1

look on the configuration tab of the writer.

Atmo answered 1/9, 2023 at 6:26 Comment(1)
Although this doesn't answer the question as asked by the OP, it certainly appears to be correct information for Amazon Aurora. i.e. Configuration tab of the writer instance in the cluster, not configuration tab of the cluster.Columbia
G
1

if you don't specify a name and there is no name the Connection would be database name for example mysql

Gail answered 21/4 at 17:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.