Let's connect VS Code with RDS for MySQL

Search for a command to run...

No comments yet. Be the first to comment.
"ddrescue got your data off the dying drive. Now what? This is where you actually get it back." 🚑 The Big Picture First A lot of people think ddrescue restores data. It doesn't — not directly. Here
"Your hard drive is making a clicking sound. Your stomach drops. Don't panic — ddrescue has your back." 🤔 What Even Is ddrescue? Imagine your hard drive is a library. Some books are fine. Some are
Most teams treat SELinux as an obstacle. The teams that thrive in production treat it as a superpower. Here's everything you need to know to move from frustrated to fluent. If you've ever Googled a
Application Load Balancer? A load balancer serves as the single point of contact for clients. The load balancer distributes incoming application traffic across multiple targets, such as EC2 instances, in multiple Availability Zones. This increases th...

In this Lab you will get the idea of the following: Created an Amazon EC2 launch template Created an Amazon EC2 Auto Scaling launch configuration Configured scaling policies and created auto Scaling group to scale in and scale out the number of se...

Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.
In this lab, we are going to create a basic database in RDS to understand how to establish the connection between the RDS database and VS Code. So that we can access the database created in RDS and use it from VS Code text editor.
Search RDS and Select it

Then Click on Create database and config as the information given:
Choose a database creation method: Standard
Engine option: MySQL
Templates: Free tier
Settings:
DB instance identifier: demo-db
Credentials Settings > Master Username: admin
Credentials Settings > Master password: **********
Credentials Settings > Confirm master password: **********
Storage:
Storage type: General Purpose SSD(gp2)
Storage autoscaling: you can uncheck Enable storage autoscaling
Connectivity:
Compute resource: Don’t connect to an EC2 compute resource
Virtual private cloud (VPC): Default VPC
{ Note: If you don't have Default VPC and don't know how to create VPC you can learn from my Here and comment if any doubt. }
Public access: Yes
VPC security group (firewall): Leave default
Availability Zone: You can choose any
Database authentication: Check Password authentication
Monitoring: Unchecked
Additional configuration:
Initial database name: demo
Backup: Uncheck enable automated backups
Encryption: Uncheck Enable encryption
Leave all Default and Create database
After sometime when Status of database modifying or Available
click on demo-bd -> Scroll down in Connectivity & Security
For future use Copy Endpoint marked as:

Search VPC and Select it
Scroll the left-side-bar and select the security groups
Click on the Security group ID which has the Security group name: default
Click on Edit inbound rules
Click Add rule
Type: MYSQL/Aurora
Source: Anywhere-IPv4 i.e. 0.0.0.0/0 (- If you created a new security group add this rule as inbound as well )
Save rules
Install VS Code
Download following extensions



Create any directory or folder on your computer
open the folder and right click

Click on Open in Terminal and type the following command to open that folder in VS Code directly
code .
Click on SQLTools symbol

Also, click on Add New Connection

Select MySQL and fill as:

Click on TEST CONNECTION enter the password you set above while creating RDS
You should get Successfully connected! message

Now Click on SAVE CONNECTION -> CONNECT NOW
CONGRATULATIONS YOU HAVE SUCCESSFULLY CONNECTED WITH RDS
Now you can do any SQL query and run on VS Code...