AnalyticDB for MySQL is a cloud-hosted, petabyte-scale, real-time data warehouse built for high-concurrency online analytical processing (OLAP). This topic walks you through creating and using an AnalyticDB for MySQL cluster, from setup to job development.
Data Lakehouse Edition is no longer available for new purchases. If you already purchased a Data Lakehouse Edition cluster, you can still follow this topic to use it.
Preparations
You have an Alibaba Cloud account.
If you do not have one, go to the or the Alibaba Cloud website to register. If your organization requires multiple users to access resources collaboratively, create Resource Access Management (RAM) users under your Alibaba Cloud account (root account) and assign them permissions. This lets each RAM user access only the resources they need.
If you are using AnalyticDB for MySQL Enterprise Edition, Basic Edition, or Data Lakehouse Edition for the first time, read Product introduction to learn about the product concepts, benefits, and common scenarios of AnalyticDB for MySQL.
Costs
Creating a cluster incurs compute and storage costs. For details, see Pricing for Enterprise Edition and Basic Edition and Pricing for Data Lakehouse Edition.
Procedure
Step 1: Create a cluster
Log on to the AnalyticDB for MySQL console. In the upper-right corner of the page, click Create Cluster.
On the purchase page, configure key parameters to quickly select your cluster type. Keep other parameters at their default values. For more parameter details, see Create a cluster.
Configuration item
Description
Product Type
Pay-as-you-go: Pay by the hour after usage. Best for short-term needs. Release the cluster when done to save costs.
Subscription: Pay upfront when you create the cluster. Best for long-term needs. Offers lower prices than pay-as-you-go, with bigger discounts for longer subscription durations.
Edition
Enterprise Edition: Multi-replica edition. Uses multi-replica storage and distributed computing. Provides high availability (HA).
Basic Edition: Single-replica edition. Uses single-replica storage. Does not provide HA.
For more information about Enterprise Edition and Basic Edition, see Editions.
Deployment Mode
Enterprise Edition: Supports single-zone deployment or multi-zone deployment.
ImportantMulti-zone deployment is supported only in China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Shenzhen), China (Hong Kong), and Singapore.
Basic Edition: Fixed to single-zone deployment.
Region
The geographic location where the cluster runs. You cannot change the region after purchase. Choose the region closest to your business to improve access speed.
Primary Zone
Select the primary zone for your cluster.
Secondary Zone
Select the secondary zone for your cluster. If the primary zone fails, service automatically switches to the secondary zone. During the switch, the cluster may become unavailable for reads or writes, or experience timeouts.
ImportantSet this parameter only if Deployment Mode is set to multi-zone deployment.
Virtual private cloud (VPC)
vSwitch in primary zone
vSwitch in secondary zone
If you already created a VPC that fits your network plan, select it. For example, if you created an ECS instance in a VPC that meets your plan, select that VPC.
If you did not create a VPC that fits your plan, use the default VPC and vSwitch.
If the default VPC and vSwitch do not meet your needs, create your own VPC and vSwitch.
ImportantIf you use other Alibaba Cloud services such as Elastic Compute Service (ECS) or ApsaraDB RDS, make sure your AnalyticDB for MySQL cluster and those services are in the same VPC. Otherwise, they cannot interconnect over the internal network and will not perform optimally.
Set vSwitch in secondary zone only if Deployment Mode is set to multi-zone deployment.
Reserved resource node specifications
Default reserved resource node specifications are 8 ACU. These support:
Data computation. Increasing reserved resources improves query speed.
Each group of reserved resources supports up to 8 TB of hot data storage. You pay for hot data storage based on actual usage.
NoteIf you previously purchased Data Warehouse Edition or Data Lakehouse Edition, see Mapping between Enterprise Edition and Data Lakehouse Edition or Data Warehouse Edition specifications when selecting Enterprise Edition specifications.
Number of reserved resource nodes
Enterprise Edition clusters: Default is 3 nodes. Step size is 3.
NoteInEnterprise Edition, you can set the number of reserved resource nodes to 0. When you do, the purchase price no longer appears in the lower-right corner of the page. Note the following:
If the number of reserved resource nodes is 0, you can only use external tables. To use internal tables in AnalyticDB for MySQL, set the number to greater than 0.
If you set the number of reserved resource nodes to 0 when creating the cluster, you can add reserved resources later by scaling out. For details, see Scaling for Enterprise Edition and Basic Edition.
Basic Edition clusters: Default is 1 node. Step size is 1.
Complete the remaining purchase steps as prompted in the console.
After payment succeeds, wait about 10–15 minutes. On the Clusters page, the cluster status changes to Running when creation completes.
Step 2: Create a database account
AnalyticDB for MySQL supports these database accounts:
Privileged account: Can manage all standard accounts and databases. Equivalent to the root account in MySQL.
Standard account: Requires manual permission grants. For differences between privileged and standard accounts and how to create them, see Privileged and standard accounts.
This topic uses a privileged account to describe the steps for creating one.
On the Clusters page, click the ID of your target cluster to open the cluster details page.
In the navigation pane on the left, click Accounts.
On the Database Accounts tab, click Create Account.
In the Create Account panel, set the parameters.
Parameter
Description
Database Account
Name for the privileged account. Enter a valid name as prompted.
Account Type
Select Privileged Account.
New Password
Password for the privileged account. Enter a valid password as prompted.
Confirm Password
Re-enter the privileged account password.
Description
Optional notes about the account to help with future management.
Click OK to create the account.
NoteAfter you create a standard account, click Actions next to the account, then click Permissions to set its permissions.
Step 3: Create a resource group
AnalyticDB for MySQL isolates compute resources across resource groups. This protects core workloads from complex computations and unexpected spikes.
To facilitate subsequent job development and testing, this section uses a Job resource group as an example to describe the creation steps. You can also create a resource group for the corresponding engine based on your job development type. The supported resource group types are listed below. For more information about resource groups and computing engines, see Create and manage resource groups and Features.
Type | Executed task | Common scenarios |
Interactive resource group | You must specify an engine during creation. Supported tasks:
| High QPS, low response time (RT) online or interactive analytics scenarios. |
Job resource group | No engine required during creation. Supports:
| High-throughput offline scenarios. |
AI resource group | MLSQL model execution and Ray-managed compute. | Heterogeneous computing scenarios. |
In the navigation pane on the left of the cluster details page, click Cluster Management > Resource Management.
Click the Resource Groups tab. In the upper-left corner of the resource group list, click Create Resource Group.
Enter a Resource Group Name. For Job Type, select Job.
NoteIn this tutorial, set Minimum Computing Resources to 0 ACU and Maximum Computing Resources to 8 ACU. These values are for quick-start testing only.
Click OK.
Step 4: (Optional) Run the built-in test script in the SQL editor
If you only want to quickly try or test the cluster, follow this section to load and analyze the built-in dataset.
In the navigation pane on the left of the cluster details page, click .
On the Databases and Tables tab, click Load Built-in Dataset.
On the Scripts tab, double-click the script and run the SQL statement in the SQLConsole to test the cluster.
NoteFor table details in the built-in dataset, see Built-in dataset table details.
Step 5: Develop jobs
Type | Prerequisites | |
Appearance | Spark SQL job development | You created a Job resource group or Interactive resource group with Spark engine. |
Xihe BSP SQL job development | You created a Job resource group. | |
Internal table | Spark SQL job development | You created a Job resource group or Interactive resource group with Spark engine.
|
Xihe BSP SQL job development | You created a Job resource group. Data Lakehouse Edition clusters must have at least 16 ACU of compute reserved resources and 24 ACU of storage reserved resources. | |
What to do next
After you complete this tutorial, see Data import for more information about the next steps.

