Creating a DB Instance Running the MySQL Database Engine
The basic building block of Amazon RDS is the DB instance. The DB instance is where you create your MySQL databases.
You must complete the tasks in the Setting Up for Amazon RDS section before you can create or connect to a DB instance.
AWS Management Console
To launch a MySQL DB instance
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
In the top right corner of the AWS Management Console, select the region in which you want to create the DB instance.
In the navigation pane, click Instances.
Click Launch DB Instance to start the Launch DB Instance Wizard.
The wizard opens on the Select Engine page.
In the Launch DB Instance Wizard window, click the Select button for the MySQL DB engine.
The next step asks if you are planning to use the DB instance you are creating for production. If you are, select Yes. By selecting Yes, the failover option Multi-AZ and the Provisioned IOPS storage option will be preselected in the following step. Click Next when you are finished.
On the Specify DB Details page, specify your DB instance information. The following table shows settings for an example DB instance. Click Next when you are finished.
For this parameter... ...Do this:
MySQL has only one license model. Select the default,
General-Public-License, to use the general license agreement for MySQL.
DB Engine Version
Select the version of MySQL that you want to work with. Note that Amazon RDS supports several versions of MySQL.
DB Instance Class
Select a DB instance class that defines the processing and memory requirements for the DB instance. For more information about all the DB instance class options, see DB Instance Class.
Determine if you want to create a standby replica of your DB instance in another Availability Zone for failover support. For more information about multiple Availability Zones, see Regions and Availability Zones.
Type a value to allocate storage for your database (in gigabytes). 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 Storage Types.
Select the storage type you want to use. For more information about storage, see Storage for Amazon RDS.
DB Instance Identifier
Type a name for the DB instance that is unique for your account in the region you selected. You may choose to add some intelligence to the name such as including the region and DB Engine you selected, for example
Type a name using alphanumeric characters that you will use as the master user name to log on to your DB instance. The default privileges granted to the master user name account include: create, drop, references, event, alter, delete, index, insert, select, update, create temporary tables, lock tables, trigger, create view, show view, alter routine, create routine, execute, create user, process, show databases, grant option.
Type a password that contains from 8 to 16 printable ASCII characters (excluding /,", and @) for your master user password.
Re-type the Master Password for confirmation.
On the Configure Advanced Settings page, provide additional information that RDS needs to launch the MySQL DB instance. The table shows settings for an example DB instance. Specify your DB instance information, then click Next Step.
For this parameter... ...Do this:
Select the name of the Amazon Virtual Private Cloud (VPC) that will host your MySQL DB instance. If your DB instance will not be hosted in a VPC, select Not in VPC. For more information about VPC, see Amazon Virtual Private Cloud (VPCs) and Amazon RDS.
DB Subnet Group
This setting depends on the platform you are on. If you are a new customer to AWS, select
default, which will be the default DB subnet group that was created for your account. If you are creating a DB instance on the previous E2-Classic platform and you want your DB instance in a specific VPC, select the DB subnet group you created for that VPC. For more information about VPC, see Amazon Virtual Private Cloud (VPCs) and Amazon RDS.
Yesto give the DB instance a public IP address, meaning that it will be accessible outside the VPC (the DB instance also needs to be in a public subnet in the VPC); otherwise, choose
No, so the DB instance will only be accessible from inside the VPC. For more information about hiding DB instances from public access, see Hiding a DB Instance in a VPC from the Internet.
Determine if you want to specify a particular Availability Zone. If you selected Yes for the Multi-AZ Deployment parameter on the previous page, you will not have any options here. For more information about Availability Zones, see Regions and Availability Zones.
DB Security Groups
Select the security group you want to use with this DB instance. For more information about security groups, see Working with DB Security Groups.
Type a name for your default database of 1 to 64 alpha-numeric characters. If you do not provide a name, Amazon RDS will not 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 MySQL Database Engine.
Specify the port that applications and utilities will use to access the database. MySQL installations default to port 3306. The firewalls at some companies block connections to the default MySQL port. If your company firewall blocks the default port, choose another port for the new DB instance.
DB Parameter Group
Select a DB Parameter Group, which is used to manage your DB engine configuration. Each MySQL version has a default parameter group you can use, or you can create your own parameter group. For DB engine configurations that you frequently use or to increase your database engine uptime, you can create your own DB parameter group. For more information about parameter groups, see Working with DB Parameter Groups.
Select an Option Group, which is used to enable and configure DB engine features. Each MySQL version has a default option group you can use, or you can create your own option group. For more information about option groups, see Working with Option Groups.
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.
Yesto enable encryption at rest for this DB instance. For more information, see Encrypting Amazon RDS Resources.
Backup Retention Period
Select the number of days for Amazon RDS to automatically back up your DB instance. You can recover your database to any point in time during that retention period. For more information, see Working With Backups.
Specify the period of time during which your DB instance is backed up. During the backup window, storage I/O may be suspended while your data is being backed up and you may experience elevated latency. This I/O suspension typically lasts for the duration of the snapshot. This period of I/O suspension is shorter for Multi-AZ DB deployments, since the backup is taken from the standby, but latency can occur during the backup process. For more information, see Working With Backups.
Enable Enhanced Monitoring
Choose Yes to enable gathering metrics in real time for the operating system that your DB instance runs on. For more information, see Enhanced Monitoring.
Only available if Enable Enhanced Monitoring is set to
Yes. Set the interval, in seconds, between when metrics are collected for your DB instance.
Auto Minor Version Upgrade
Yesif you want to enable your DB instance to receive minor DB Engine version upgrades automatically when they become available.
Select the weekly time range during which system maintenance can occur. For more information about the maintenance window, see Adjusting the Preferred DB Instance Maintenance Window.
In addition, Federated Storage Engine is currently not supported by Amazon RDS for MySQL.
The Point-In-Time-Restore and Snapshot Restore features of Amazon RDS for MySQL require a crash recoverable storage engine, and these two features are supported only for the InnoDB storage engine. While MySQL supports multiple storage engines with varying capabilities, not all of them are optimized for crash recovery and data durability. For example, the MyISAM storage engine does not support reliable crash recovery and may result in lost or corrupt data when MySQL is restarted after a crash, preventing Point-In-Time-Restore or Snapshot restore from working as intended.
If you would like to convert existing MyISAM tables to InnoDB tables, you can use the alter table command (e.g., alter table TABLE_NAME engine=innodb;). Note that MyISAM and InnoDB have different strengths and weaknesses, so you should fully evaluate the impact of making this switch on your applications before doing so.
Click Launch DB Instance to create your MySQL DB instance.
On the final page of the wizard, click Close.
On the Amazon 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 the DB instance. Depending on the DB instance class and store allocated, it could take several minutes for the new instance to be available.
To create a MySQL DB instance, use the AWS CLI create-db-instance command. The following parameters are required:
The following example creates a MySQL db instance named mydbinstance.
For Linux, OS X, or Unix:
aws rds create-db-instance \ --db-instance-identifier
aws rds create-db-instance ^ --db-instance-identifier
This command should produce output similar to the following:
DBINSTANCE mydbinstance db.m3.medium mysql 20 sa creating 3 **** n 5.6.27 SECGROUP default active PARAMGRP default.mysql5.6 in-sync
To create a MySQL DB instance, use the Amazon RDS API CreateDBInstance command. The following parameters are required:
The following example creates a MySQL db instance named mydbinstance.
https://rds.us-west-2.amazonaws.com/ ?Action=CreateDBInstance &AllocatedStorage=20 &BackupRetentionPeriod=3 &DBInstanceClass=db.m3.medium &DBInstanceIdentifier=mydbinstance &DBName=mydatabase &DBSecurityGroups.member.1=mysecuritygroup &DBSubnetGroup=mydbsubnetgroup &Engine=mysql &MasterUserPassword=<masteruserpassword> &MasterUsername=<masterawsuser> &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140213/us-west-2/rds/aws4_request &X-Amz-Date=20140213T162136Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=8052a76dfb18469393c5f0182cdab0ebc224a9c7c5c949155376c1c250fc7ec3