In this tutorial, you will learn how to create an environment to run your MariaDB database (we call this environment an 'instance'), connect to the database, and delete the DB instance. We will do this using Amazon Relational Database Service (Amazon RDS) and everything done in this tutorial is free tier eligible.

Manage Your AWS Resources

Sign in to the Console

When you click here, the AWS management console will open in a new browser window, so you can keep this step-by-step guide open. When this screen loads, find RDS under Database and click to open the Amazon RDS Console.

AWS Console Image

(click to zoom)

create-mariadb-db-0

In this step, we will use Amazon RDS to create a MariaDB instance with a db.t2.micro DB instance class, 5 GB of storage, and automated backups enabled with a retention period of one day.  As a reminder, all of this is free tier eligible.


a. In the top right corner of the Amazon RDS console, select the Region in which you want to create the DB instance.

Note: Amazon cloud computing resources are housed in highly available data center facilities in different areas of the world. Each Region contains multiple distinct locations called 'Availability Zones,' or AZs. You have the ability to choose which Region to host your Amazon RDS activity in. 

create-mariadb-db-1

(click to zoom)

create-mariadb-db-1

b.   In the navigation pane on the left, click Instances. Then click Launch DB Instance.

 

 

create-mariadb-db-2

(click to zoom)

create-mariadb-db-2

c.  You now have options to select your engine. For this tutorial, select the MariaDB icon and click Select.

create-mariadb-db-3

(click to zoom)

create-mariadb-db-3

d. The next screen gives you options to choose your environment. Select the MariaDB option under Dev/Test and click Next Step.

create-mariadb-db-4

(click to zoom)

create-mariadb-db-4

e. You will now configure your DB instance. Select the checkbox next to Only show options that are eligible for RDS Free Tier.

Expand the dropdown below to see the example settings you can use for this tutorial: 

Instance Specifications:

  • License Model: Leave the default generic-public-license.
  • DB Engine Version: Select the default version.
  • DB Instance Class: Select db.t2.micro --- 1vCPU, 1 GIB RAM. This equates to 1 GB memory and 1 vCPU. To see a list of supported instance classes, see Amazon RDS Product Details.
  • Storage Type: Select General Purpose (SSD). For more information about storage, see Storage for Amazon RDS.
  • Allocated Storage: Type 5 allocate 5 GB of storage for your database. You can scale up to a maximum of 6 TB with Amazon RDS for MariaDB.
  • Multi-AZ Deployment: Select No to create your DB instance in a single Availability Zone for this tutorial. Using a Multi-AZ Deployment will automatically provision and maintain a synchronous standby replica in a different Availability Zone. Note that you will have to pay for Multi-AZ Deployment. For more information, see High Availability Deployment.

Settings:

  • DB Instance Identifier: Type a name for the DB instance that is unique for your account in the Region you selected. For this tutorial, enter myrdstest.
  • Master Username: Type a username that you will use to log in to your DB instance. We will use masterUsername in this example.
  • Master Password: Type a password that contains from 8 to 41 printable ASCII characters (excluding /,", and @) for your master user password.
  • Confirm Password: Retype your password.

Click Next Step.

create-mariadb-db-5

(click to zoom)

create-mariadb-db-5

f. You are now on the Configure Advanced Settings page where you can provide additional information that RDS needs to launch the MariaDB DB instance. Expand the dropdown below to see the example settings for your DB instance.

Network & Security
  • Publicly Accessible: Choose Yes. This will allocate an IP address for your database instance so you can directly connect to the database from your own device.
  • VPC Security Group(s): Select Create New Security Group. This will create a security group that will allow connection from the IP address of the device you are currently using, to the database created.

Database Options

  • Database Name: : Type a database name that is 1 to 64 alpha-numeric characters. If you do not provide a name, Amazon RDS will not automatically create a database on the DB instance you are creating.
  • Database Port: Leave the default value of 3306.
  • Option Group: Select the default value of default.mariadb-10-0. Amazon RDS uses option groups to enable and configure additional features. For more information, see Working with Option Groups.
  • Copy Tags to Snapshots: leave this unchecked

Backup

  • Backup Retention Period: You can choose the number of days to retain the backup you take. For this tutorial, set this value to 1.
  • Backup Window: Use the default of No Preference.

Monitoring

  • Enable Enhanced Monitoring: Use the default of No to stay within the free tier. Enabling Enhanced Monitoring will give you metrics in real time for the operating system (OS) that your DB instance runs on. For more information, see Viewing DB Instance Metrics.

Maintenance

  • Auto Minor Version Upgrade: Select Yes to receive automatic updates when they become available.
  • Maintenance Window: Select No Preference.

Click Launch DB Instance

create-mariadb-db-6

(click to zoom)

create-mariadb-db-6

g. Your DB Instance is now being created.  Click View Your DB Instance.  

Click Instances to track the status of your DB instance launch. When the status changes from creating to available, the DB instance is ready for usage.

Note: It can take several minutes for the new DB instance to become available. Feel free to move on to the next step as you wait.

create-mariadb-db-7

(click to zoom)

create-mariadb-db-7

Once the database instance creation is complete and the status changes to available, you can connect to a database on the DB instance using any standard SQL client. As MariaDB is compatible with MySQL, we will download MySQL Workbench, a popular MySQL client.


a. Go to the Download MySQL Workbench page to download and install MySQL Workbench. For more information on using MySQL, go to MySQL Documentation.

Note:  Remember to use MySQL Workbench from the same device from which you created the DB Instance. The security group your database is placed in is configured to allow connection only from the device from which you created the DB instance.

create-mariadb-db-8

(click to zoom)

create-mariadb-db-8

b. You will be prompted to login, sign up, or begin your download.  You can click No thanks, just start my download for a quick download.

create-mariadb-db-9

(click to zoom)

create-mariadb-db-9

In this step, we will connect to the database you created using MySQL Workbench.


a. Launch the MySQL Workbench application and go to Database > Connect to Database (Ctrl+U) from the menu bar.

create-mariadb-db-10

(click to zoom)

create-mariadb-db-10

b. A dialogue box appears.  Enter the following:

  • Hostname: You can find your hostname on the Amazon RDS console as shown in the screenshot to the right.  Enter or paste the hostname of the DB Instance running the MariaDB database engine. For example, the hostname name could be: myrdstest.cg034hpkmmjt.us-east-1.rds.amazonaws.com.
  • Port: The default value should be 3306.
  • Username: Type in the username you created for the Amazon RDS database.  Our example was 'masterUsername.'
  • Password: Click Store in Vault and enter the password you used while creating the Amazon RDS database.

Click OK

 

create-mariadb-db-11

(click to zoom)

create-mariadb-db-11

c. You are now connected to the database. On the MySQL Workbench, you will see various schema objects available in the database. Now you can start creating tables, insert data, and run queries.

create-mariadb-db-12

(click to zoom)

create-mariadb-db-12

You can easily delete the MariaDB DB Instance from the Amazon RDS console. In fact, it is a best practice to delete instances you are no longer using so you don’t keep getting charged for them.


a. Go back to your Amazon RDS Console.  Select Instance Actions and click Delete from the dropdown menu.

 

create-mariadb-db-13

(click to zoom)

create-mariadb-db-13

b. You are asked to create a final snapshot. For this tutorial, select No in the drop-down, check the acknowledgment box, and click Delete. 

    Note: Deleting your DB Instance may take a few minutes.

create-mariadb-db-14

(click to zoom)

create-mariadb-db-14

You have created, connected to, and deleted a MariaDB Database Instance with Amazon RDS.  Amazon RDS makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database administration tasks, freeing you up to focus on your applications and business.

Now that you have learned to create and connect to a MariaDB Database through Amazon RDS, you can progress to the next tutorial where you will learn to restore a DB Instance from a DB Snapshot.

Restore a DB Instance from a DB Snapshot

Yes
No