All Products
Document Center

Connect to a Database

Last Updated: Apr 07, 2020

After you created a user, you need obtain following required information to connect to the database:

  1. Set a whitelist: The whitelist includes the public or private IP addresses that can be used to access this database.

    Go to the Tenant Details page, and on the Connection Info tab, click the Edit button in the Access Whitelist field to set the whitelist.

  2. IP address and port number: After accessing the Tenant Details page, go to the Connection Info tab and get IP address and port number in the Primary Address field.

    • Clicking Apply to obtain a public IP address when you first access Connection Info tab.

    • Obtain the private IP address that is displayed on the Connection Info tab.

  3. Account information: Go to the Tenant Details page, and obtain account information on the Account tab.

ApsaraDB for OceanBase uses a protocol that is compatible with MySQL. You can connect to ApsaraDB for OceanBase by MySQL 5.6 client.

Statement Format:

  1. mysql -u <username> -p -h <IP address> -P <port number>


  1. mysql -u root -p -h -P 3306