You can call the ModifyDBInstanceConnectionString operation to change the endpoint and port number for an ApsaraDB RDS instance.

ApsaraDB RDS provides the internal and public endpoints. ApsaraDB RDS also allows hybrid access by using both a Virtual Private Cloud (VPC) endpoint and a classic network endpoint.

Note
  • You can change only the prefix of an endpoint.
  • The read/write splitting endpoint cannot be changed.

Debugging

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 ModifyDBInstanceConnectionString

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

DBInstanceId String Yes rm-uf6wjk5****

The ID of the instance.

CurrentConnectionString String Yes rm-uf6wjk5x****.mysql.rds.aliyuncs.com

The endpoint of the instance. It can be an internal endpoint, a public endpoint, or a classic network endpoint in hybrid access mode.

Note The read/write splitting endpoint cannot be changed.
ConnectionStringPrefix String Yes rm-****

The prefix of the endpoint after the change. Only the prefix of the value of the CurrentConnectionString parameter can be changed.

Note The value can be 8 to 64 characters in length and can contain letters, digits, and hyphens (-). The value cannot contain any of the following characters: ~ ! # % ^ & * = + \ | {} ; : ' " , <> / ?
Port String Yes 3306

The port number after the change.

BabelfishPort String No 1433

The TDS port of the instance for which Babelfish is enabled.

Note This parameter applies only to ApsaraDB RDS for PostgreSQL instances. For more information about Babelfish for ApsaraDB RDS for PostgreSQL, see Introduction to Babelfish.
GeneralGroupName String No rgc-bp1tkv8****

The name of the dedicated cluster to which the instance belongs. This parameter takes effect only when the instance runs MySQL on RDS Standard Edition and is created in a dedicated cluster.

Response parameters

Parameter Type Example Description
RequestId String 65BDA532-28AF-4122-AA39-B382721EEE64

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyDBInstanceConnectionString
&DBInstanceId=rm-uf6wjk5****
&CurrentConnectionString=rm-uf6wjk5x****.mysql.rds.aliyuncs.com
&ConnectionStringPrefix=rm-****
&Port=3306
&GeneralGroupName=rgc-bp1tkv8****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyDBInstanceConnectionStringResponse>
       <RequestId>65BDA532-28AF-4122-AA39-B382721EEE64</RequestId>
</ModifyDBInstanceConnectionStringResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : " 65BDA532-28AF-4122-AA39-B382721EEE64"
}

Error codes

HTTP status code Error code Error message Description
400 DnsConflict Dns is conflict with other custins. The error message returned because the DNS server conflicts with other clients.
400 InvalidConnectionString.Malformed The specified parameter "ConnectionStringPrefix" is not valid. The error message returned because the format of the endpoint is invalid. You need to specify a valid value. The value can be 8 to 64 characters in length and can contain letters, digits, and hyphens (-). The value cannot contain any of the following characters: ~ ! # % ^ & * = + \ | {} ; : ' " , <> / ?
400 OperationDenied.DBInstanceStatus The operation is not permitted due to status of instance. The error message returned because the operation is not supported when the instance is in the current state.
400 InvalidConnectionString.NotFound The specified connection string or network type is not found. The error message returned because the endpoint that you specified cannot be found. You need to check whether the specified endpoint is valid.
400 InvalidConnectionString.Duplicate The specified connection string needs to be same as current network type. The error message returned because the endpoint or port must be the same as that for the instance of the current network type.
400 MissingConnectionString The request is missing a ConnectionString parameter. The error message returned because the request does not contain the classic network endpoint whose validity period you want to extend.
400 OtherEndpoint.Exist Other endpoint exist. The error message returned because the specified prefix of the public endpoint already exists.

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