All Products
Search
Document Center

AnalyticDB:Use the MySQL command-line client to connect to AnalyticDB for MySQL

Last Updated:Sep 11, 2024

The MySQL command-line client can be used to remotely connect to AnalyticDB for MySQL. This topic describes the connection command and provides an example.

Command

mysql -hadb_url -P3306 -uadb_user -padb_password      

Parameters

  • adb_url: the endpoint of the AnalyticDB for MySQL cluster to which you want to connect. You can obtain the endpoint in the Network Information section of the Cluster Information page in the AnalyticDB for MySQL console.

  • 3306: the port number of the AnalyticDB for MySQL cluster. Set the value to 3306.

  • adb_user: the database account that is used to connect to the AnalyticDB for MySQL cluster. The account can be a privileged account or a standard account that has the required permissions.

  • adb_password: the password of the database account.

Example

mysql -ham-bp****.ads.aliyuncs.com -P3306 -utest -pTest123