Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 457
Kamilski81 Avatar asked Mar 29 '17 16:03

Kamilski81


People also ask

What is the database name in AWS RDS?

Amazon RDS currently supports MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server, and Amazon Aurora database engines.

Can you rename an RDS instance?

You can now change the name and endpoint of your existing DB Instances via the AWS Management Console, Amazon RDS API, or the Amazon RDS command line toolkit. DB instance renaming feature is available with all RDS-supported database engines (i.e. MySQL, Oracle, and SQL Server) and in all AWS regions.

How do I change my master name on RDS?

With RDS for MySQL, the answer is no, the master username cannot be changed, presumably because permissions are tied to usernames, and changing the username would leave the database objects with that user as DEFINER stranded without a valid definer.


2 Answers

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

Addtional Configuration

like image 162
nakulthebuilder Avatar answered Sep 19 '22 18:09

nakulthebuilder


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.

like image 40
Michael - sqlbot Avatar answered Sep 16 '22 18:09

Michael - sqlbot