Before you start to use ApsaraDB for RDS, you must create databases and accounts for an RDS instance. This topic describes how to create databases for an ApsaraDB RDS for PPAS instance.

For an ApsaraDB RDS for PPAS instance, you must create a privileged account in the ApsaraDB for RDS console. You can create and manage databases by using Alibaba Cloud Data Management (DMS).

Terms

  • Instance: a virtualized database server on which you can create and manage multiple databases.
  • Database: a set of data that is stored together in a certain way and can be shared by multiple users. A database provides the smallest redundancy. It is a data warehouse independent of the application.
  • Character set: a collection of letters and special characters and their encoding rules used in a database.

Prerequisites

An ApsaraDB RDS for PPAS instance is created. For more information, see Create an ApsaraDB RDS for PPAS instance.

Precautions

  • Databases within the same instance share all of the resources that belong to the instance. You can create multiple databases for each ApsaraDB RDS for PPAS instance. You can also use SQL statements to create and manage databases.
  • To migrate an on-premises database to an RDS instance, you must create a database and an account with the same names on the RDS instance.

Procedure

  1. Log on to the ApsaraDB for RDS console.
  2. In the top navigation bar, select the region where the target RDS instance resides.Select a region
  3. Find the target RDS instance and click its ID.
  4. Add the IP address that is used to access the RDS instance to the RDS whitelist. For more information about how to configure a whitelist, see Configure a whitelist for an ApsaraDB RDS for PPAS instance.
  5. Start the pgAdmin 4 client.
  6. Right-click Servers and choose Create > Server.
  7. On the General tab of the Create - Server dialog box, enter the name of the server.
  8. Click the Connection tab, and enter the information of the target RDS instance.

    Parameter description:

    • Host name/address: Enter the endpoint of your RDS instance. If you connect to your RDS instance over the internal network, enter the internal endpoint of your RDS instance. If you connect to your RDS instance over the Internet, enter the public endpoint your RDS instance. To view the internal and public endpoints and port numbers of your RDS instance, follow these steps:

      1. Log on to the ApsaraDB for RDS console.
      2. In the top navigation bar, select the region where the target RDS instance resides.
      3. Find the target RDS instance and click its ID.
      4. On the Basic Information page, find the internal or public endpoint and their port numbers.
    • Port: Enter the port number of your RDS instance. If you connect to your RDS instance over the internal network, enter the internal port number of your RDS instance. If you connect to your RDS instance over the Internet, enter the public port number of your RDS instance.

    • Username: Enter the privileged account name of your RDS instance.

    • Password: Enter the password for the privileged account of your RDS instance.

  9. Click Save.
  10. If the connection information is correct, choose Servers > Server Name > Databases > postgres. The connection is successful if the following interface is displayed.
    Note postgres is the default system database of the RDS instance. Do not perform any operation in this database.
  11. Click postgres and choose Tools > Query Tool.
  12. Enter the following command on the Query-1 tab to create a database:
    create database <database name>;
  13. Click the Execute/Refresh icon.
  14. If the execution is successful, the database is created. Right-click Databases and select Refresh. Then you can find the new RDS database.

What to do next

Create an ApsaraDB RDS for PPAS instance.