• 沒有找到結果。

Creating a MariaDB DB instance

and connecting to a database

Getting started with Amazon RDS

In the following examples, you can find how to create and connect to a DB instance using Amazon Relational Database Service (Amazon RDS). You can create a DB instance that uses MariaDB, MySQL, Microsoft SQL Server, Oracle, or PostgreSQL.

Important

Before you can create or connect to a DB instance, make sure to complete the tasks in Setting up for Amazon RDS (p. 92).

Creating a DB instance and connecting to a database on a DB instance is slightly different for each of the DB engines. Choose one of the following DB engines that you want to use for detailed information on creating and connecting to the DB instance. After you have created and connected to your DB instance, there are instructions to help you delete the DB instance.

Topics

• Creating a MariaDB DB instance and connecting to a database on a MariaDB DB instance (p. 98)

• Creating a Microsoft SQL Server DB instance and connecting to it (p. 106)

• Creating a MySQL DB instance and connecting to a database on a MySQL DB instance (p. 115)

• Creating an Oracle DB instance and connecting to a database on an Oracle DB instance (p. 123)

• Creating a PostgreSQL DB instance and connecting to a database on a PostgreSQL DB instance (p. 129)

• Tutorial: Create a web server and an Amazon RDS DB instance (p. 140)

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 AWS Management Console. After you create the DB instance, you can use command line tools such as mysql or 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, make sure to complete the tasks in Setting up for Amazon RDS (p. 92).

Topics

• Creating a MariaDB DB instance (p. 98)

• Connecting to a database on a DB instance running the MariaDB database engine (p. 102)

• Deleting a DB instance (p. 105)

Creating a MariaDB DB instance

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

Creating a MariaDB DB instance

You can use Easy create to create a DB instance running MariaDB with the AWS Management Console.

With Easy create, you specify only the DB engine type, DB instance size, and DB instance identifier. Easy create uses the default settings for the other configuration options. When you use Standard create instead of Easy create, 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.

NoteFor information about creating DB instances with Standard create, see Creating an Amazon RDS DB instance (p. 174).

To create a MariaDB DB instance with Easy create

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.

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.

Creating a MariaDB DB instance

9. To use an automatically generated master password for the DB instance, make sure that the Auto generate a password box is selected.

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

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

Creating a MariaDB DB instance

You can examine the default settings used with Easy create. The Editable after database is created column shows which options you can change after database creation.

• To change settings with No in that column, use Standard create.

• To change settings with Yes in that column, either use Standard create, or modify the DB instance after it is created to change the settings.

The following are important considerations for changing the default settings:

• In some cases, you might want your DB instance to use a specific virtual private cloud (VPC) based on the Amazon VPC service. Or you might require a specific subnet group or security group. If so, use Standard create to specify these resources. You might have created these resources when you set up for Amazon RDS. For more information, see Provide access to your DB instance in your VPC by creating a security group (p. 95).

Connecting to a database on a DB instance running MariaDB

• If you want to be able to access the DB instance from a client outside of its VPC, use Standard create to set Public access to Yes.

If the DB instance should be private, leave Public access set to No.

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.

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 an Amazon RDS DB instance (p. 308).

12. For Databases, choose the name of the new Maria 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.

Connecting to a database on a DB instance running

相關文件