All Products
Search
Document Center

PolarDB:Connect to a PolarDB-X database

Last Updated:Nov 13, 2023

This topic describes how to connect to a PolarDB-X database by using Data Management Service (DMS). You can also connect to a PolarDB-X database by using SQL command line tools, third-party program code that conforms to the official MySQL protocol, and third-party clients such as MySQL Workbench, SQLyog, Sequel Pro, and Navicat for MySQL.

Background information

DMS offers an integrated solution that supports data management, schema management, server management, user authorization, security audit, trend analysis, data tracking, business intelligence (BI) charting, and performance analysis and optimization.

Procedure

  1. Log on to the PolarDB for Xscale console.

  2. In the top navigation bar, select the region where the target instance is located.

  3. On the Instances page, click the PolarDB-X 2.0 tab.

  4. Find the target instance and click its ID.

  5. In the left-side navigation pane of the instance details page, choose ConfigurationManagement > Database management.

  6. In the upper-right corner of the page that appears, click Log On to Database.

  7. In the dialog box that appears, configure parameters described in the following table.

    Parameter

    Description

    Database Type

    By default, the value of this parameter is set to DRDS. You do not need to change the value. PolarDB-X is previously known as Distributed Relational Database Service (DRDS).

    Instance Region

    By default, the region in which the current instance is deployed is selected. You do not need to change the value.

    Note

    If you want to log on to a database in a PolarDB-X instance that is deployed in another region, select the region in which the instance is deployed from the drop-down list.

    Instance ID

    By default, the ID of the current instance is selected. You do not need to change the value.

    Note

    If you want to log on to a database in a PolarDB-X instance that is deployed in another region, select the ID of the instance from the drop-down list.

    Database

    The name of the database. This parameter is optional.

    Database Account

    The username of the account that is used to log on to the database.

    Database Password

    The password of the account.

    Note

    If you select Remember password, you do not need to enter the username or password of the account the next time you log on to the database.

    Control Mode

    The mode used to manage the database. Valid values: Flexible Management, Stable Change, and Security Collaboration.

    Note
    • This parameter is automatically set to Flexible Management the first time you use DMS to log on to the database. You can change the value of this parameter after you log on to the database. For more information, see Modify database instances and Control modes.

    • After you configure the parameters, you can click Test connection in the lower-left corner of the dialog box. If the database fails to be connected, troubleshoot given cluster information based on the error message. For example, check whether the username or password is correct.

    • DMS automatically adds the IP addresses and CIDR blocks of the DMS servers that are deployed in the same region as the PolarDB-X instance to the IP address whitelist of the instance. If the IP addresses and CIDR blocks fail to be added to the IP address whitelist of the instance, you must manually add them.

  8. Click Login.

What to do next

After you use DMS to connect to your PolarDB-X database, you can execute basic SQL statements. For more information, see Basic SQL operations.