This topic describes how to connect to an ApsaraDB RDS for MariaDB instance. After you complete the initial configurations, you can connect to your RDS instance from an Elastic Compute Service (ECS) instance or your computer.
The following operations are completed:
Use DMS to connect to an RDS instance
DMS is a graphical data management service that allows you to manage relational databases and NoSQL databases. It provides various functions, such as data management, schema management, user authorization, security audit, trend analysis, data tracking, business intelligence (BI) charts, and performance analysis and optimization.
Log on the ApsaraDB RDS console, find the RDS instance to which you want to connect, and go to the Databases page. On the Databases page, find the database that you want to manage, and click SQL Query in the Actions column. On the logon page of DMS, enter the logon information as prompted to connect to the RDS instance.
Use a client to connect to an RDS instance
ApsaraDB RDS for MySQL is fully compatible with open source MySQL. You can connect to an RDS instance from a database client by using a similar method that you use to connect to an open source MySQL database. In the following example, the HeidiSQL client is used.
- Start the HeidiSQL client.
- In the lower-left corner of the Session manager dialog box, click New.
- Enter information about the RDS instance that you want to connect. The following table
describes the parameters.
Parameter Description Network type Select the network type of the RDS instance. For this example, select MariaDB or MySQL (TCP/IP). Hostname / IP Enter the internal or public endpoint of the RDS instance.
- If the HeidiSQL client is deployed on an ECS instance that resides in the same region and has the same network type as the RDS instance, enter the internal endpoint. For example, if the ECS and RDS instances both reside in virtual private clouds (VPCs) of the China (Hangzhou) region, you can use the internal endpoint to establish a secure connection.
- In other scenarios, enter the public endpoint.
For more information about how to view the internal and public endpoints and the port numbers of the RDS instance, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for MySQL instance.
User Enter the username of the account that you use to connect to the RDS instance. Password Enter the password of the account. Port Enter the port number of the RDS instance. If you want to connect to the RDS instance over an internal network, enter the internal port number of the RDS instance. If you want to connect to the RDS instance over the Internet, enter the public port number of the RDS instance. For more information, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for MySQL instance.
- Click Open.
If the connection information is correct, the RDS instance is connected.
How do I obtain data from ApsaraDB RDS to Function Compute?
You can install third-party dependencies on Function Compute. Then, you can use these built-in dependencies to obtain data from ApsaraDB RDS.For more information, see Install third-party dependencies.