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

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

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. After you create 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

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

Creating a MariaDB Instance

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

Note

A new console interface is available for database creation. Choose either the New Console or the Original Console instructions based on the console that you are using. The New Console instructions are open by default.

New Console

You can create a DB instance running MariaDB with the AWS Management Console with Easy Create enabled or not enabled. With Easy Create enabled, you specify only the DB engine type, DB instance size, and DB instance identifier. Easy Create uses the default setting for other configuration options. With Easy Create not enabled, you specify more configuration options when you create a database, including ones for availability, security, backups, and maintenance.

In this example, you use Easy Create to create a DB instance running the MariaDB database engine with a db.t2.micro DB instance class.

Note

For information about creating a MariaDB DB instance with Easy Create not enabled, see Creating a DB Instance Running the MariaDB Database Engine.

To create a MariaDB DB instance with Easy Create enabled

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

  2. In the upper-right corner of the Amazon RDS console, choose the AWS Region in which you want to create the DB instance.

  3. In the navigation pane, choose Databases.

  4. Choose Create database and make sure that Easy Create is chosen.

    
            						Easy Create option
  5. In Configuration, choose MariaDB.

  6. For DB instance size, choose Free tier.

  7. For DB instance identifier, enter a name for the DB instance, or leave the default name.

  8. For Master username, enter a name for the master user, or leave the default name.

    The Create database page should look similar to the following image.

    
            						Create database page
  9. To use an automatically generated master password for the DB instance, make sure that the Auto generate a password check box is chosen.

    To enter your master password, clear the Auto generate a password check box, and then enter the same password in Master password and Confirm password.

  10. (Optional) Open View default settings for Easy create.

    
            						Easy Create default settings.

    You can examine the default settings used when Easy Create is enabled. If you want to change one or more settings during database creation, choose Standard Create to set them. The Editable after database creation column shows which options you can change after database creation. To change a setting with No in that column, use Standard Create. For settings with Yes in that column, you can either use Standard Create or modify the DB instance after it's created to change the setting.

  11. Choose Create database.

    If you chose to use an automatically generated password, the View credential details button appears on the Databases page.

    To view the master user name and password for the DB instance, choose View credential details.

    
            						Master user credentials after automatic password generation.

    To connect to the DB instance as the master user, use the user name and password that appear.

    Important

    You can't view the master user password again. If you don't record it, you might have to change it. If you need to change the master user password after the DB instance is available, you can modify the DB instance to do so. For more information about modifying a DB instance, see Modifying a DB Instance Running the MariaDB Database Engine.

  12. For Databases, choose the name of the new MariaDB DB instance.

    On the RDS console, the details for new DB instance appear. The DB instance has a status of creating until the DB instance is ready to use. When the state changes to available, you can connect to the DB instance. Depending on the DB instance class and the amount of storage, it can take up to 20 minutes before the new instance is available.

    
            						Summary during DB instance creation
Original Console

In this example, you create a DB instance running the MariaDB database engine called mariadb-instance1, with a db.t2.small DB instance class, 20 GiB 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 upper-right corner of the Amazon RDS console, choose the AWS Region in which you want to create the DB instance.

  3. In the navigation pane, choose Databases.

    If the navigation pane is closed, choose the menu icon at the upper left to open it.

  4. Choose Create database. The Select engine page opens.

    
									Engine selection
  5. Choose MariaDB, and then choose Next.

  6. The Choose use case page asks if you plan to use the DB instance you are creating for production. Because this is an example instance, choose Dev/Test - MariaDB. Then choose Next.

    Note

    If you create a production instance, you typically choose Production - MariaDB 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 Parameter Do 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 GiB memory, 1 ECU (1 virtual core with 1 ECU), 64-bit platform, and moderate I/O capacity.

    Multi-AZ deployment

    Choose Create replica in a different zone 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) for Amazon RDS.

    Storage type

    Choose the storage type General Purpose (SSD). For more information about storage, see Amazon RDS DB Instance Storage.

    Allocated storage

    Enter 20 to allocate 20 GiB 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 RDS Features.

    DB instance identifier

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

    Master username

    Enter a name using 1–16 alphanumeric characters to use as the master user name to log on to your DB instance. You use this user name to log on to your database on the DB instance for the first time.

    Master password and Confirm password

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

    
							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 Create database.

    For This Parameter Do This

    Virtual Private Cloud (VPC)

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

    Subnet group

    Choose Create new DB subnet group.

    Public accessibility

    Choose Yes.

    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 Create new VPC security group.

    Database name

    Enter a name for your default database that is 1–64 alphanumeric characters. If you don't provide a name, Amazon RDS doesn'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

    Keep 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.

    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.

    Encryption

    Choose Disable encryption.

    Note

    You usually choose Enable encryption 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 day.

    Backup window

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

    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 Disable enhanced monitoring.

    Log exports

    Select General log. For more information, see MariaDB Database Log Files.

    Auto minor version upgrade

    Choose Enable auto minor version upgrade to enable your DB instance to receive preferred 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.

  9. Choose Create database.

  10. Choose View DB instance details.

    On the RDS console, the details for new DB instance appear. The DB instance has a status of creating until the DB instance is ready to use. When the state changes to available, you can connect to the DB instance. Depending on the DB instance class and the amount of storage, it can take up to 20 minutes before the new instance is available.

    
						My DB instances details

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

After 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, see the Download HeidiSQL page. For more information on using MariaDB, see the MariaDB documentation.

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

  1. Find the endpoint (DNS name) and port number for your DB instance.

    1. Open the RDS console and then choose Databases to display a list of your DB instances.

    2. Choose the MariaDB DB instance name to display its details.

    3. On the Connectivity & security tab, copy the endpoint. Also, note the port number. You need both the endpoint and the port number to connect to the DB instance.

      
        							Connect to a MariaDB DB instance
  2. Enter 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 (endpoint) 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

    After you enter the password for the user, you should 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

After 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. In the navigation pane, choose Databases.

  3. Choose the DB instance you want to delete.

  4. For Actions, choose Delete.

  5. For Create final snapshot?, choose No, and select the acknowledgment.

  6. Choose Delete.