How do I connect with AWS RDS? (using MySQL workbench)
Tags: aws, database, mysql, devjournal
Published: 2022-12-07 17:07:03

AWS RDS is a database service by Amazon that is used to launch highly scalable database clusters. The service hones database engines like Amazon Aurora, MySQL, MariaDB, Oracle, and PostgreSQL. Instead of providing shell access to the database server, AWS is only responsible for providing a connection string to connect with the database server. 


AWS RDS (Relational Database Service) is a managed database service provided by Amazon Web Services to launch a highly available and scalable database cluster. [AWS RDS](https://www.simform.com/blog/rds-vs-ec2/) provides different database engines like Amazon Aurora, MySQL, MariaDB, MS SQL Server, Oracle, and PostgreSQL. AWS does not provide shell access to the database server; it only provides a connection string to connect to the database server.

There are various methods that can be used to connect with the RDS database. But, by far, the most popular one is connecting with MySQL Workbench. Let’s take a closer look at how it’s done!

##Connect using MySQL Workbench

MySQL Workbench is a GUI application that is readily available for Windows, Linux, and macOS. Apart from providing visibility to relational databases, it is used to provide a query tool to perform SQL queries. Here are the steps that you to follow in order to connect to Amazon RDS using MySQL Workbench

- Install the workbench on your local machine. If you are using Linux or Ubuntu, it is advisable to update your repositories before installing MySQL Workbench.
- Create an AWS RDS instance from the AWS management console specifying the region where you want to deploy your instance. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ujygrk5srr6mth9r2jag.jpg)

- Select standard create and MySQL as the Engine type


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pz1diuv3u3uwbikpyoi2.jpg)

- Configure the whole setup using [Amazon AWS guidelines](https://aws.amazon.com/premiumsupport/knowledge-center/connect-rds-mysql-workbench/) to prepare RDS for connecting with MySQL workbench.
- Once the configuration is complete, go to MySQL Workbench, and click on the (+) symbol to add database parameters. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d2u2owf7hzh400dc4dcq.png)

- Enter all the connection parameters and click on Test Connection to connect with the database server. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9c10rviqzqi68o6jrv0.png)

- Once you do that, it will ask you for the password of the RDS instance. Enter the password and click OK to test the connection.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d04qgaqx951mbh05sywx.png)

- After entering the password, a notification will pop up telling you whether or not the connection is successful.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jobwe5jv18fy6g5su0zo.png)

- Once the test is complete, for a new connection, click on the “OK” button instead of “Test Connection” to add the AWS RDS instance connection.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oxzcz40n0om4yj0by5ya.png)

- It will automatically add a MySQL connection on the MySQL Workbench dashboard. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wfwadosz6r2pn3ieya0.png)

- For connecting with the AWS RDS instance, double-click on the newly formed connection, and it will start the RDS instance. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrwcjlv54bpdc658lia9.png)

- A popup window will appear which will ask you for the RDS password again. Enter the password and click OK to connect to the instance.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frnyexue7nc3iwsr8edy.png)

- After connecting with the instance, it will open an intuitive GUI for the RDS on the MySQL Workbench.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2itjaun84f59niprnv7.png)

- For creating a new schema using MySQL Workbench, click on the “new schema” button on the menu bar. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ygnpb58if48y7km5jac0.png)

- A new tab will open up asking for a schema name to be created.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl791jlls3zr335bsx4y.png)

- After new schema name is created, it will open a new window with the SQL query to create the new schema.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/epepu7bu0k28rw7yd2if.png)