All Products
Search
Document Center

Connect to a database

Last Updated: Jan 04, 2020

After you create a user, you can obtain the required information in the ApsaraDB for OceanBase console 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. On the Connection tab, click Settings.

  2. Obtain the IP address and port number.

    • On the Connection tab, click Apply to obtain a public IP address.

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

  3. Obtain the account information.

    On the Accounts tab, obtain the account information.

Connect to a database

ApsaraDB for OceanBase uses a protocol that is compatible with MySQL. You can connect to ApsaraDB for OceanBase by using the same method.

Example:

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

Example:

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