By Clarisa Maman Orfali
In a previous article we learned how to create an account in Amazon Web Services (AWS). Besides knowing what Amazon RDS is, we learned how to configure an Oracle Database Instance in Amazon RDS. Here are the links for each installment of the article (Spanish language only): Part I and Part II.
In the current article we will learn how to create an instance of the MySQL database for development and testing using the Amazon RDS service.
MySQL is a relational database developed under a dual GPL/Business License by Oracle Corporation and is considered to be the most popular open source database in the world, and one of the most popular databases in general, along with Oracle and Microsoft SQL Server. MySQL is mainly used in web development environments.
In the Part I of the previous article we created an IAM user in our AWS so that we do not have to work with the root account.
To login to the AWS admin console, we access the custom URL that was given to us when we created the IAM user:
We access the AWS homepage, and then expand the "All services" link:
In the Database section, select the RDS option:
The Amazon Relational Database Service home page appears:
To create an Instance of the MySQL database, we click on the "Get Started Now" button.
A page appears where we can select the database engine that we want to use. We select MySQL.
We click the Select button.
A page appears where we can select the type of use that we are going to give to the database. In this demo we will select Dev/Test.
We click the Next Step button.
We set the option "Only show options that are eligible for RDS Free Tier" to show us the options that are free in the first year of use of AWS services. If we would like to see all the options that are presented, we don’t check this option.
The Amazon RDS Free Tier provides a single db.t2.micro instance as well as up to 20GB of storage, allowing new AWS customers to gain hands-on experience with Amazon RDS.
We select the class of the Database Instance:
Type: Micro Instance - Current Generation
vCPU: 1 vCPU
EBS Optimized: No
Network Performance: Low
Free Tier Eligible: Yes
Current Generation DB Instance Classes
Standard (Latest Generation)
db.m4.large | db.m4.xlarge | db.m4.2xlarge | db.m4.4xlarge | db.m4.10xlarge
Standard (Previous Generation)
db.m3.medium | db.m3.large | db.m3.xlarge | db.m3.2xlarge
db.r3.large | db.r3.xlarge | db.r3.2xlarge | db.r3.4xlarge | db.r3.8xlarge
db.t2.micro | db.t2.small | db.t2.medium | db.t2.large
Note: For MySQL .m4 = 5.5,5.6,5.7
Storage Type: select “General Purpose (SSD)”
Amazon RDS provides three storage types: Magnetic, General Purpose (SSD), and Provisioned IOPS (input/output operations per second). They differ in performance characteristics and price, allowing us to adapt storage performance and cost to the workload needs of our database. In our example, we are only showing the features that are free, so only the options of General Purpose (SSD) and Magnetic are enabled.
Once we have selected the specifications of the Instance, we need to enter the following configurations at the bottom of the page:
We can view the advanced settings page. As the page shows, we have configured the following:
In the section “Network & Security”:
In the section “Database Options”:
In the “Backup” section:
The rest of the options are on default and we click on the “Launch DB Instance” button.
Now we can see that the Instance has been created successfully.
To access the newly created instance we click on the “View Your DB Instances” button and then click on the arrow to expand the information about the Instance.
We can see that the instance is available, but there is not access permission. To solve this problem, we click on the triangle icon and then on the “Edit Security Group” button of the tooltip.
We access the EC2 Dashboard, where we can see the Security Group “default”, which is the one we use for this demonstration. At the bottom of the screen we can see 4 tabs. Select the second ("Inbound") tab and click on the Edit button.
We add a new rule by clicking the “Add Rule” button:
We now click the Save button.
Return to the instance page and refresh. Now we can see that access is authorized.
Connect to the MySQL database from our PC with SQL Developer
It is necessary that our SQL Developer has the JDBC driver for MYSQL, if we don’t have it we can download it from here.
Unzip the file and save the ".jar" file path.
Open SQL Developer and go to the "Tools/Preferences ..." menu and then in the modal window that opens, click on the "Database" section to expand the section and select the option "Third Party JDBC Drivers". We need to add a new entry and then add the path for the .jar file we had previously downloaded and unzipped. This way, we can add the option of connecting to MySQL databases in our SQL Developer.
We are now in a position to create a new connection.
Then we connect to the MySQL database we created in Amazon RDS.
Finally, we can create a demo table in the database as an example:
Following these very simple steps, we have created an instance of the MySQL database in Amazon RDS using an Amazon Web Services account, through which we can connect to it from our local PC using SQL Developer.