This guide shows you how to create and connect to your first PolarDB cluster.
Choose a version
Before you create a cluster, select the PolarDB version that best fits your business needs. Each version offers different syntax compatibility, features, and use cases. Choosing the right version is crucial for system performance, compatibility, and maintainability.
PolarDB database | Compatibility | Use cases |
PolarDB for MySQL | MySQL 5.6, 5.7, and 8.0 | Ideal for most Online Transaction Processing (OLTP) workloads, such as websites, mobile applications, and SaaS services. Recommended if you use or are familiar with MySQL. |
PolarDB for PostgreSQL | PostgreSQL 14 to 16 | Supports rich SQL features, geospatial data processing, and powerful extension capabilities. Suitable for enterprise applications, data analytics, and scenarios requiring advanced feature development. |
PolarDB for PostgreSQL (Compatible with Oracle) | Oracle | Highly compatible with Oracle syntax. Helps businesses migrate on-premises Oracle databases to the cloud with minimal cost and risk. |
PolarDB Distributed Edition | MySQL | Uses a distributed architecture that supports horizontal scaling. Ideal for processing massive datasets and handling high-concurrency workloads, such as large-scale e-commerce and core financial systems. |
Create and connect to your first cluster
Process overview:
Select an engine and complete the basic configuration in the console to create a cluster.
Create a database account and password for the cluster.
Get the cluster's endpoint and port.
Connect to the database using a client tool or code, then run a query to verify the connection.
Step 1: Create a cluster
Log on to the PolarDB console and go to the cluster creation page.
Select an engine that matches your use case, as described in Choose a version.
Node specifications: For initial testing, select the minimum configuration to control costs.
Network: For better security, use a Virtual Private Cloud (VPC) and keep public access disabled.
Step 2: Create a database account
After the cluster is created, create a privileged account or a standard account in the Account Management section of the cluster details page, and set a strong password that contains uppercase letters, lowercase letters, numbers, and special characters.
Step 3: Get the endpoint
In the Basic Information section of the cluster details page, find and copy the primary endpoint and port, for example, pc-xxxx.mysql.polardb.rds.aliyuncs.com:3306.
Step 4: Connect and verify
You can use any standard database client to connect. The following example uses the MySQL command-line interface:
Connect to the database
In the command below, replace the placeholder endpoint, port, and username with your credentials. You will be prompted for your password.mysql -h pc-xxxx.mysql.polardb.rds.aliyuncs.com -P 3306 -u <username> -pVerify the connection
Run a simple SQL query. A successful query returns the database version, confirming your connection.SELECT VERSION();
Billing
Creating a PolarDB cluster incurs immediate charges. Charges are primarily for compute nodes, storage space, and backup storage. To avoid continuous billing for test or development clusters, release resources after use. For more information, see Product Billing.