Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Creating a MariaDB DB Instance and Connecting to a Database on a MariaDB DB Instance

The easiest way to create a MariaDB DB instance is to use the Amazon RDS console. Once you have created the DB instance, you can use command line tools such as mysql or standard graphical tools such as HeidiSQL to connect to a database on the DB instance.

Important

You must complete the tasks in the Setting Up for Amazon RDS section before you can create or connect to a DB instance.

Creating a MariaDB Instance

The basic building block of Amazon RDS is the DB instance. This environment is where you will run your MariaDB databases.

In this example, you create a DB instance running the MariaDB database engine called east1-mariadb-instance1, with a db.t2.small DB instance class, 5 GB of storage, and automated backups enabled with a retention period of one day.

To create a MariaDB DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the top right corner of the Amazon RDS console, choose the region in which you want to create the DB instance.

  3. In the navigation pane, choose Instances.

  4. Choose Launch DB Instance. The Launch DB Instance Wizard opens on the Select Engine page.

    Engine selection

  5. On the Select Engine page, choose the MariaDB icon, and then choose Select for the MariaDB engine.

  6. Next, the Production? page asks if you plan to use the DB instance you are creating for production. Because this is an example instance, choose No. When you are finished, choose Next.

    Note

    If you create a production instance, you typically choose Yes on this page to enable the failover option Multi-AZ and the Provisioned IOPS storage option.

  7. On the Specify DB Details page, specify your DB instance information. The following table shows settings for an example DB instance. When the settings are as you want them, choose Next.

    For This ParameterDo This

    License Model

    Choose the default, general-public-license, to use the GNU General Public License, version 2 for MariaDB. MariaDB has only one license model.

    DB Engine Version

    Choose the version of MariaDB that you want to use.

    DB Instance Class

    Choose db.t2.small for a configuration that equates to 2 GB memory, 1 ECU (1 virtual core with 1 ECU), 64-bit platform, and moderate I/O capacity.

    Multi-AZ Deployment

    Choose Yes to have a standby replica of your DB instance created in another Availability Zone for failover support. We recommend Multi-AZ for production workloads to maintain high availability. For development and testing, you can choose No.

    For more information, see High Availability (Multi-AZ).

    Storage Type

    Choose the storage type Magnetic. For more information about storage, see Storage for Amazon RDS.

    Allocated Storage

    Type 5 to allocate 5 GB of storage for your database. In some cases, allocating a higher amount of storage for your DB instance than the size of your database can improve I/O performance. For more information about storage allocation, see Amazon Relational Database Service Features.

    DB Instance Identifier

    Type a name for the DB instance that is unique for your account in the region you chose. You can add some intelligence to the name, such as including the region and DB engine you chose, for example east1-mariadb-instance1.

    Master Username

    Type a name using 1-16 alphanumeric characters that you will use as the master user name to log on to your DB instance. You'll use this user name to log on to your database on the DB instance for the first time.

    Master Password and Confirm Password

    Type a password that contains from 8 to 41 printable ASCII characters (excluding /,", and @) for your master user password. You'll use this password with the user name when you log on to your database. Type the password again in the Confirm Password box.

    DB instance details

  8. On the Configure Advanced Settings page, provide additional information that RDS needs to launch the MariaDB DB instance. The table shows settings for an example DB instance. Specify your DB instance information, then choose Launch DB Instance.

    For This ParameterDo This

    VPC

    Choose the name of the Amazon Virtual Private Cloud (Amazon VPC) that will host your MariaDB DB instance. For more information about using VPC, see Amazon RDS and Amazon Virtual Private Cloud (VPC).

    Availability Zone

    Determine if you want to specify a particular Availability Zone. For more information about Availability Zones, see Regions and Availability Zones.

    VPC Security Groups

    Choose the VPC security group you want to use with this DB instance. For more information about VPC security groups, go to Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.

    Database Name

    Type a name for your default database that is 1 to 64 alphanumeric characters. If you don't provide a name, Amazon RDS won't automatically create a database on the DB instance you are creating.

    To create additional databases, connect to the DB instance and use the SQL command CREATE DATABASE. For more information about connecting to the DB instance, see Connecting to a DB Instance Running the MariaDB Database Engine.

    Database Port

    Leave the default value of 3306 unless you have a specific port you want to access the database through. MariaDB installations default to port 3306.

    DB Parameter Group

    Accept the default value of default.mariadb10.0 unless you created your own DB parameter group. For more information about parameter groups, see Working with DB Parameter Groups.

    Option Group

    Accept the default value of default.mariadb-10-0.

    Copy Tags To Snapshots

    Choose this option to have any DB instance tags copied to a DB snapshot when you create a snapshot. For more information, see Tagging Amazon RDS Resources.

    Enable Encryption

    Choose No.

    Note

    You usually choose Yes for production instances to enable encryption at rest for this DB instance. For more information, see Encrypting Amazon RDS Resources.

    Backup Retention Period

    Set the number of days you want automatic backups of your database to be retained. For testing purposes, you can set this value to 1.

    Backup Window

    Unless you have a specific time that you want to have your database back up, use the default of No Preference.

    Enable Enhanced Monitoring

    Unless you want to enable gathering metrics in real time for the operating system that your DB instance runs on, use the default of No.

    Auto Minor Version Upgrade

    Choose Yes to enable your DB instance to receive minor DB engine version upgrades automatically when they become available.

    Maintenance Window

    Choose the 30 minute window in which pending modifications to your DB instance are applied. If the time period doesn't matter, choose No Preference.

    Additional Configuration panel

  9. On the RDS console, the new DB instance appears in the list of DB instances. The DB instance will have a status of creating until the DB instance is created and ready for use. When the state changes to available, you can connect to a database on the DB instance. Depending on the DB instance class and store allocated, it can take several minutes for the new DB instance to become available.

    My DB instances list

Connecting to a Database on a DB Instance Running the MariaDB Database Engine

Once Amazon RDS provisions your DB instance, you can use any standard SQL client application to connect to a database on the DB instance. In this example, you connect to a database on a MariaDB DB instance using the mysql command-line tool. One GUI-based application you can use to connect is HeidiSQL; for more information, go to the Download HeidiSQL page. For more information on using MariaDB, go to the MariaDB documentation.

To connect to a database on a DB instance using the mysql command-line tool

Type the following command at a command prompt on a client computer to connect to a database on a MariaDB DB instance. Substitute the DNS name for your DB instance for <endpoint>, the master user name you used for <mymasteruser>, and provide the master password you used when prompted for a password.

PROMPT> mysql -h <endpoint> -P 3306 -u <mymasteruser> -p <master password>

You will see output similar to the following.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 272
Server version: 5.5.5-10.0.17-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql >

Deleting a DB Instance

Once you have connected to the sample DB instance that you created, you should delete the DB instance so you are no longer charged for it.

To delete a DB instance with no final DB snapshot

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. For Instances, choose the DB instance you want to delete.

  3. For Instance Actions, choose Delete.

  4. For Create final Snapshot?, choose No.

  5. Choose Yes, Delete.