How to Create and Connect to a PostgreSQL Database?

21YunBox
3 min readJan 8, 2021

--

From PostgreSQL’s Official Website

What is PostgreSQL?

PostgreSQL is older but very powerful open source relational database.

PostgreSQL supports most of the SQL standards and provides many other modern features such as complex queries, foreign keys, triggers, views, transaction integrity, and so on. Generally it is loved by developers of startups around the world.

21YunBox provides a fully managed (free of operations and maintenance) PostgreSQL database.

How to Create a PostgreSQL Database in China?

  1. Register as 21YunBox member
  2. Select “Database” in the console
  3. Then click “Add Database”
  4. Create with the following configuration

Note: Database name and Database user name cannot be changed once created.

You will find that in the above configuration, the database password is not filled in. This is because the system will automatically generate it and no additional filling is required.

Create a PostgreSQL database showing a configuration screenshot

If you are not sure how to do it, you can watch this example video.

How to Remotely Connect to the Database?

In most cases, we connect to the database to: add, delete, modify or search and other actions that are connected by code. We have automatically spliced ​​the URL connected to the database, to complete the configuration, you only need to paste it .

How to Connect to the Database Under the Intranet?

Under the intranet of 21YunBox, you can directly use database URL to connect.

For details, please refer to the database connection section:

Screenshot of PostgreSQL after creation

How to connect to a Database Under the External Network?

Under 21YunBox’s external network, you can use the client visual interface tools such as DBeaver, or Postico, or directly use command line to connect.

If you are not sure what to do, please watch the following video:

  1. Use DBeaver to connect to the database:
  2. Use the command line to connect to the database:

How to Backup the Database?

21YunBox provides 7 days of free cloud database backup, which is rolled daily and stored in a multi-backup cloud disk in .dump format.

An example of a PostgreSQL backup file after creation

21YunBox is a Cloud Service Platform based out of Beijing, China. Our services provides you with an easy and budget friendly, end-to-end web platform deployment service within China for all applications. No matter your stack, we have a flexible solution to assist.

If needed, we also offer full support in obtaining your ICP license which allows you to legally host online content within Mainland China.

To learn about the differences between 21YunBox and these foreign (outside of China) Cloud Service Platforms? You can refer to:

Originally published at https://launch-in-china.21yunbox.com on January 8, 2021.

--

--