All Products
Search
Document Center

ApsaraDB RDS:Connect to an ApsaraDB RDS for MariaDB instance

Last Updated:Feb 07, 2024

After you purchase an ApsaraDB RDS for MariaDB instance and complete the required configurations for your RDS instance, such as account creation and whitelist configuration, you can connect to your RDS instance by using Data Management (DMS) or a client. This topic describes how to connect to an RDS instance by using DMS or a client.

Prerequisites

The following operations are complete:

Procedure

Use DMS to connect to an RDS instance

Note

DMS is a GUI-based tool that is developed by Alibaba Cloud. DMS can be used to manage relational databases and NoSQL databases and supports data management, schema management, user authorization, security audit, data trend analysis, data tracking, business intelligence (BI) reporting, and performance optimization.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the upper-right corner of the page that appears, click Log On to Database.

  3. In the dialog box that appears, enter the username and password of the account that is used to log on to the RDS instance. Then, click Login.

    Note

    To obtain the username and password of an account, you can perform the following operations:

    1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
    2. In the left-side navigation pane of the page that appears, click Accounts.

    3. If you forget your password, click Reset Password to reset the password.

  4. After the logon is successful, double-click the name of the database in the left-side navigation pane to switch to the database.

Use a database client to connect to an RDS instance

ApsaraDB RDS is fully compatible with open source MariaDB. You can connect to the RDS instance from a common database client by using a similar method that can be used to connect to an open source MariaDB database. In the following example, the HeidiSQL client is used.

  1. Start the HeidiSQL client.

  2. In the lower-left corner of the Session manager dialog box, click New.

  3. Enter information about the RDS instance to which you want to connect. The following table describes the required parameters. 连接信息

    Parameter

    Description

    Network type

    Select the network type of the RDS instance. For example, select MariaDB or MySQL (TCP/IP).

    Library

    Select the dynamic-link library. Retain the default value.

    Hostname / IP

    Enter the internal or public endpoint of the RDS instance. Example: rm-bp1xxxxxxxxxxxxxx.mysql.rds.aliyuncs.com. For more information about how to view the internal and public endpoints of an RDS instance, see View and change the internal and public endpoints and port numbers.

    • If your client is deployed on an Elastic Compute Service (ECS) instance that resides in the same region and has the same network type as the RDS instance, use the internal endpoint. For example, if the ECS and RDS instances are both in a VPC located in the China (Hangzhou) region, you can use the internal endpoint of the RDS instance to create a secure connection.

    • In other scenarios, enter the public endpoint of the RDS instance.

    User

    Enter the username of the account that is used to connect to the RDS instance. For more information about how to create an account, see Create a database and an account on an ApsaraDB RDS for MariaDB instance.

    Password

    The password of the preceding account.

    Port

    If you connect to the RDS instance over an internal network, enter the internal port number of the instance. If you connect to the RDS instance over the Internet, enter the public port number of the instance. For more information, see View and change the internal and public endpoints and port numbers.

  4. Click Open.

    If the preceding parameters are properly configured, the RDS instance can be connected.

    连接成功

The following common errors may occur:

  • Unknown MySQL server hose 'xxxxxxxxx'(11001)

    If this error occurs, check whether the Hostname / IP parameter is properly set. If this parameter is set to the ID or IP address of the RDS instance, the connection fails. You must set this parameter to the internal or public endpoint of the RDS instance.

  • Access denied for user 'xxxxx'@'xxxxx'(using password:YES)

    If this error occurs, check whether the username and password of an account that is created on the RDS instance are properly specified. If you enter the username and password of your Alibaba Cloud account, the connection fails. You can create an account on the Accounts page of the RDS instance.

  • The response is slow, and the "Can't connect to MySQL server on 'rm-bp1xxxxxxxxxxxxxx.mysql.rds.aliyuncs.com'(10060)" message is returned.

    If this error occurs, check whether the public IP address of the server that hosts HeidiSQL is added to an IP address whitelist of the RDS instance. For information about how to configure a whitelist, see Configure an IP address whitelist.

    Note

    You can temporarily add the 0.0.0.0/0 entry to an IP address whitelist of the RDS instance. If you can connect to the RDS instance by using HeidiSQL after the 0.0.0.0/0 entry is added, this error occurs due to an improperly configured IP address whitelist. You must obtain the actual public IP address of the server that runs HeidiSQL. For more information, see Why am I unable to connect to my ApsaraDB RDS for MySQL instance or ApsaraDB RDS for MariaDB instance from a local server over the Internet?

FAQ

How do I use Function Compute to obtain data from my RDS instance?

You can install third-party dependencies for your functions in Function Compute and use built-in modules to obtain the data of your RDS instance. For more information, see Install third-party dependencies for a function.