This topic describes how to use the MySQL command-line tool to connect to an AnalyticDB for MySQL cluster.

Syntax

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 endpoint. The default port number is 3306.
  • adb_user: the account 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 account used to connect to the AnalyticDB for MySQL cluster.

Example

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