Connect to an AnalyticDB for MySQL cluster using the MySQL command-line client to run queries and manage your database remotely.
Prerequisites
Before you begin, ensure that you have:
Added the IP address of the machine running the MySQL command-line client to the IP address whitelist of your cluster. If you haven't configured a whitelist yet, see Configure a whitelist.
Connect to the cluster
Get the cluster endpoint from the AnalyticDB for MySQL console:
On the Cluster Information page, go to the Network Information section.
Copy the endpoint displayed there.
Run the following command to connect:
mysql -h<adb_url> -P3306 -u<adb_user> -p<adb_password>Replace the placeholders with your actual values:
Placeholder Description Example <adb_url>Endpoint of the cluster, copied from the Network Information section of the Cluster Information page mv-bp1sehs22w****.ads.aliyuncs.com3306Port number. Fixed value — do not change 3306<adb_user>Database account. Use a privileged account or a standard account with the required permissions test<adb_password>Password of the database account Test123
Example
mysql -hamv-bp1sehs22w****.ads.aliyuncs.com -P3306 -utest -pTest123