Amazonrds 简明教程

Amazon RDS - MariaDB Creating DB

作为云平台,AWS 为您提供了非常少的步骤来在 RDS 中设置数据库。创建 MariaDB 有三种方式:使用 AWS 管理控制台、AWS CLI 或 AWS API。我们将一一讨论这些方法。

As a cloud platform AWS gives you very minimal number of steps to setup a DB in RDS. Creating a MariaDB can be done in three ways. Using AWS management console, AWS CLI or AWS API. We will look at each of these approaches one by one.

Using AWS management Console

AWS管理控制台是开始使用RDS最便捷的方式。使用AWS帐户详细信息登录AWS控制台,找到RDS服务,然后按照下面所示的步骤创建一个MariaDB实例。

AWS management console is the most convenient way to get started with RDS. You login to the AWS console using your AWS account details, locate the RDS service and then follow the steps shown below to create a MariaDB instance.

Step-1

从控制台中选择 MariaDB 引擎。

Select the MariaDB Engine form the console.

mariadb creation step 1

Step-2

指定所需的数据库详细信息。

Specify the required DB details.

mariadb step 2

Step-3

在本步骤中,您确定数据库实例类型、分配的存储量、设置主密码以及其他一些详细信息。

In this step you decide on the db instance class, amount of storage allocated also set the master password along with few other details.

mariadb step 3

Stpe—4

这是最后一步,其中您提到了 vpc 和安全设置、加密、备份选项和日志导出等。为了简洁起见,屏幕截图已缩短,仅显示最终选项。

This is the final step when you mention the vpc and security settings, encryption, backup options and log export etc. For brevity the screen shot has been shortened showing only the final options.

maria db step 4

Stpe—5

最后一步,我们选择创建数据库选项。

In the final step we choose the create Data base option.

maria db step 5

Using CLI

要使用 AWS CLI 创建 MariaDB 实例,请使用以下参数调用 create-db-instance 命令。

To create a MariaDB instance by using the AWS CLI, call the create-db-instance command with the parameters below.

aws rds create-db-instance \
    --db-instance-identifier mydbinstance \
    --db-instance-class db.m4.xlarge \
    --engine mariadb \
    --allocated-storage 20 \
    --master-username masteruser \
    --master-user-password masteruserpassword \
    --backup-retention-period 3

Using API

要使用 Amazon RDS API 创建 MariaDB 实例,我们使用以下所示的参数调用 CreateDBInstance 操作。

To create a MariaDB instance by using the Amazon RDS API, we call the CreateDBInstance action with the parameters as shown below.

https://rds.us-west-2.amazonaws.com/
    ?Action=CreateDBInstance
    &AllocatedStorage=20
    &BackupRetentionPeriod=3
    &DBInstanceClass=db.m4.xlarge
    &DBInstanceIdentifier=mydbinstance
    &DBName=mydatabase
    &DBSecurityGroups.member.1=mysecuritygroup
    &DBSubnetGroup=mydbsubnetgroup
    &Engine=mariadb
    &MasterUserPassword=masteruserpassword
    &MasterUsername=masterawsuser
    &Version=2014-10-31
    &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