Amazon RDS 是一项数据库云服务。
它易于设置和管理。
它是免费试用!
Amazon 关系数据库服务 (RDS) 是一种基于云的数据库服务。
Amazon RDS 解决了运行数据库的许多挑战。
借助 Amazon RDS,您可以根据需要扩展性能和存储。
Amazon RDS 管理自动备份、修补和恢复。
它支持流行的数据库产品,例如:
在开始使用 RDS 之前,您需要注册 Amazon Web Services,并设置数据库用户和安全组。
当您注册 Amazon Web Services (AWS) 时,您的 AWS 账户将自动注册 AWS 中的所有服务,包括 Amazon RDS。
如果您是 AWS 新客户,您可以免费开始使用 Amazon RDS。
AWS 免费套餐允许您在注册后免费试用 AWS 12 个月。有关更多信息,请参阅AWS 免费使用套餐。
如果您决定在免费期结束后继续使用 AWS(或者如果您需要比免费使用套餐提供的更多存储或性能),则只需为您使用的资源付费。
要创建 AWS 帐户,请转至:https://aws.amazon.com/,然后单击“注册”。
按照屏幕上的说明进行操作。记下您的 AWS 帐号,因为您稍后会需要它。
在此示例中,我们将设置一个运行 MySQL 的免费数据库实例。 (这是免费的,因为它用于测试)。
创建 MySQL 数据库实例:
For this option: | Typical Input |
---|---|
License Model | general-public-license |
DB Engine Version | Select the default version of MySQL |
DB Instance Class | Select db.t2.micro to select a configuration that is eligible for free test usage |
Multi-AZ Deployment | Select No |
Storage Type | Magnetic (Standard) |
Allocated Storage | 5 |
DB Instance Identifier | Type the name of your database instance (this is not the name of your database) |
Master Username | Type the master username for your database |
Master Password | Type the password for your master user |
Confirm Password | Conform the password |
For this option: | Typical Input |
---|---|
VPC | Default VPC |
Subnet Group | default |
Publicly Accessible | Yes |
Availability Zone | No Preference |
VPC Security Group(s) | default |
Database Name | Type the name of your database (in this example, we will show you how to create the northwind database we use for examples in the AppML tutorial) |
Database Port | 3306 (unless you need it to run on a specific port) |
DB Parameter Group | Keep the default value |
Option Group | Keep the default value |
Enable Encryption | No |
Backup Retention Period | 7 |
Backup Window | No Preference |
Auto Minor Version Upgrade | Yes |
Maintenance Window | No Preference |
databasename.
aaabbbcccddd.
region.rds.amazonaws.com:3306
要配置数据库连接,请编辑 appml_config 文件:
<?php echo("Access Forbidden");exit();?>
{
"dateformat" : "yyyy-mm-dd",
"databases" : [{
"connection" : "
mydatabase",
"host" : "
yourDatabaseURL",
"dbname" : "
yourDatabaseName",
"username" : "
yourUserName",
"password" : "
yourPassword"
}]
}
编辑以下内容:
AppML 现在应配置为连接到您的 Amazon RDS 数据库。
您现在可以用数据填充数据库:
可选:创建 IAM 用户以提高安全性
Amazon RDS,要求您在访问时提供用户名和密码。
您可以使用您的 Amazon 用户名访问该账户,但出于安全目的,我们建议您为您的数据库创建一个身份和访问管理 (IAM) 用户。
首先,创建管理员组:
然后创建 IAM 用户,并将其添加到管理员组:
要以此新 IAM 用户身份登录,请退出 AWS 控制台,然后使用以下 URL:
https://
your_aws_account_id.signin.aws.amazon.com/console/
代替your_aws_account_id包含您的 AWS 帐号(不带连字符)(如果您的帐号是 1234-5678-9012,则您的 AWS 账户 ID 是 123456789012)