AWS

How to Connect to AWS MYSQL Database

It is a very easy and simple process to connect to the AWS MySQL database using simple commands on the command prompt or PowerShell. You can save a lot of time by managing your database with commands after connecting to the AWS MySQL database. In this post, you will get to know how to connect to the AWS MySQL database.

Let’s start with the process:

Connect to the AWS MySQL Database

To connect to the AWS MySQL database, you need an AWS RDS database from the Amazon RDS dashboard. Select the Databases from the left panel, and your database list will be displayed:

After that, you simply need any MySQL environment so your RDS can be connected to that MySQL environment. For that, simply type the following command in the command prompt or PowerShell to check which MySQL version is available:

mysql --version

This will display the version of your MySQL environment:

If your MySQL is not already installed, then click here to learn how to do that

Now you need to open the command prompt as an administrator for that simply search “command prompt” in the search bar and click on run it as “Run an administrator” tab:

Once you are in the command prompt use the following command to connect your RDS database to the MySQL environment. For that, you simply need the username and password of your RDS database:

mysql -u <username> -p

After this command it will prompt you to enter the password simply type the password and press enter:

You are now connected to the AWS MySQL database through the local machine and you can use your database by viewing the databases using the following command:

SHOW Databases;

This command will show you the list of all the databases in AWS MySQL database:

You have successfully connected to the AWS MySQL database.

Conclusion

To connect to the AWS MySQL database, you need to create an RDS database from the Amazon RDS console, and your database list will be displayed on the “Databases” page. Then you need to look for the MySQL environment on your system using a simple command. After that, you will open the command prompt as an administrator and type the command for the connection to the AWS MySQL database.

About the author

Abdul Mannan

I am curious about technology and writing and exploring it is my passion. I am interested in learning new skills and improving my knowledge and I hold a bachelor's degree in computer science.