You can call this operation to test database connectivity by using a gateway.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ConnectDatabase

The operation that you want to perform. Set the value to ConnectDatabase.

DbPassword String Yes password

The password used to access the database.

DbType String Yes MySQL

The type of the database.

Note Only MySQL databases are supported.
DbUserName String Yes dg_test

The username used to access the database.

GatewayId String Yes dg-yhss6sdlaffaq68

The ID of the gateway.

Host String Yes

The address of the database accessed by using the host where the gateway resides.

Port Integer Yes 3440

The port of the database accessed by using the host where the gateway resides.

Response parameters

Parameter Type Example Description
Code String OK

The status code.

Data String xxx

The returned result.

ErrorMsg String None

The error message.

RequestId String EAF2AA07-860D-43DA-BEE8-1E43AAE024DG

The ID of the request.

Success Boolean true

Indicates whether the call is successful.


Sample requests

http(s)://dg.[regionId] Action=ConnectDatabase
&<Common request parameters>

Sample success responses

XML format


JSON format


Error codes

For a list of error codes, visit the API Error Center.