Hakan Bayraktar
1 min readJul 10, 2019

--

How to create a second database in the same RDS instance on AWS RDS

If you want to create a second database schema in running RDS instance. So you may follow the below steps.

1-Connect your RDS instance through master password.

# mysql -uusername -ppassword -h rds-hostname

2-Now in RDS instance (MySQL) shell prompt. You can create a new database and a new user

mysql> CREATE USER 'newusername'@'%' IDENTIFIED BY 'password';
mysql> CREATE DATABASE newdatabase;
mysql> GRANT ALL PRIVILEGES on newdatabase.* To newusername@'%';
mysql> FLUSH PRIVILEGES;
mysql> SHOW databases;

3- Now you be able to login with the new_user with new_database

# mysql -unewusername -ppassword -h rds-hostname

4- You be able to restore the dump (from bash shell) in your new database.

# mysql -unewusername -ppassword -h rds-hostname --database < dump.sql

--

--