Step By Step Guidelines To Connect Amazon RDS MySQL
Firstly, Create a MySQL DB instance
Step 1: Login into AWS Account.
Step 2: After signing in you will land on the AWS Mangement Console page and search for RDS as shown below.
Step 3: After landing on RDS Dashboard > Create database. This will allow us to create a MySQL DB instance.
Step 4: Select Engine Type in your case it’s MySQL.
Step 5: Select template -> Free tier. In case you are allowed to pay for your service you can use the other 2 options.
Step 6: Give the name to your DB instance, type username and password. Credentials will be required later so note them somewhere.
Step 7: Expand Storage autoscaling and uncheck Enable storage autoscaling. Enabling the auto scaling feature will increase your storage capacity automatically and will cost you so use it with caution.
Step 8: Make your IP public, this will allow you to connect the DB instance with MySQL Workbench.
Step 9: Expand the Additional configuration section and enter your Initial database name. RDS will create new database of this name.
Step 10: Go to the bottom of the page and press the Create database button.
Step 11: Wait till the database status becomes available.
Setting IP Address In Security Groups
Step 12: Click on your db identifier in this case gfg-rds. Note down the endpoint and click on the hyperlink under VPC security groups as illustrated in the following screenshot.
Step 13: Check the check box and go to Inbound rules > Edit inbound rules. You have to add your IP to the security groups to connect the DB instance from the workbench.
Step 14: Fill in the following data Type -> MYSQL/Aurora and Source -> My IP this will automatically fetch your IP.
Step 15: Save the rules and go to the RDS dashboard again. Open your DB instance (i.e. gfg-rds in my case) and reboot it.
Step 16: Connect to MySQL database
- Open MySQL Workbench and go to Database > Connect to Database or simply Ctrl+U.
Step 17: Fill data to connect DB instance with workbench. In place of Hostname fill Endpoint which you copied earlier. Add username and password in Vault.
Step 18: Press OK. This will open an editor and on the left side panel, you can see your database in my case gfgdb.
Amazon RDS MySQL Connecting to DB
Connecting your Amazon RDS MySQL database with your application is a key step for building software. In this article, we will break down the process for connecting RDS with your Database. Relational Database Service provided by Amazon on their cloud service platform called AWS (Amazon Web Services) that can create instances of various popular Relational DBMS such as MySQL, PostgreSQL, Microsoft SQL Server, etc. It is cost-efficient and can resize its capacity according to your needs.