| by Arround The Web | No comments

How to Connect to AWS RDS MySQL

By using the MySQL database, you can store and arrange your data properly. You can retrieve and store data easily by using simple commands. It saves time and storage of your system, and all the data can be kept in one place. Amazon Web Services provides the RDS service, which can be used to control your databases on the cloud.

Let’s start with the connection of the AWS RDS MySQL database.

Connect to AWS RDS MySQL

To connect to the AWS MySQL database, create a database on the Amazon RDS dashboard. Then click on the name of the database:

On this page, you can find the Endpoint of the RDS database in the “Connectivity & security” section:

Before connecting to the AWS RDS database, you need to connect to the EC2 virtual machine:

If you already have MySQL installed on your virtual machine, then skip this step:

Additional Information

After connecting to an EC2 instance enter the following command to install the MySQL server if you don’t already have it:

apt install mysql-client-core-8.0

Your MySQL client will be installed shortly:

You will need the endpoint of the RDS database for the connection command, which can be acquired by clicking on the name of the database. Enter the following command to connect to the AWS MySQL database:

mysql -h <End Point> -P 3306 -u <username> -p

The command we used is written below:

mysql -h database-1.c6d50j4forkq.ap-southeast-1.rds.amazonaws.com -p 3306 -u admin -p

After typing the command for connection, it will prompt you to enter the password simply type the password and press enter:

You are now connected to the AWS MySQL database, and you can run different commands to use your MySQL database for that simply type the following command to view the Databases available in MySQL:

SHOW Databases;

You have successfully connected to the AWS MySQL database.

Conclusion

To connect to the AWS MySQL database by using a few simple commands. First, you need to create an AWS RDS database from the Amazon RDS dashboard. Then acquire the endpoint of your database by clicking on the name of the database, and then by typing a simple command, you can connect your AWS RDS database.

Share Button

Source: linuxhint.com

Leave a Reply