Updated on 2026-07-16 GMT+08:00

Enabling M Compatibility Port

Function

This API is used to enable the M compatibility port. Before calling this API:

Debugging

You can debug this API in API Explorer.

Constraints

To enable this function, you need to ensure that there is the templatem template database in your DB instance. If there is no the template database, it will be automatically created. The templatem template database cannot be created for DB instances whose replica consistency protocol is Paxos.

URI

POST /v3/{project_id}/instances/{instance_id}/mysql-compatibility

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance. For details about how to obtain the instance ID, see Querying DB Instances.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

After a response is returned, the value of X-Subject-Token in the response header is the token.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn: Chinese
  • en-us: English

Default Value

en-us

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

port

Yes

string

Definition

Port for M compatibility.

Constraints

This port cannot be one of the following: 2378, 2379, 2380, 2400, 4999, 5000, 5001, 5100, 5500, 5999, 6000, 6001, 6009, 6010, 6500, 8015, 8097, 8098, 8181, 9090, 9100, 9180, 9187, 9200, 12016, 12017, 20049, 20050, 21731, 21732, 32122, 32123, 32124, 32125, 32126, 39001, and any port in the range [database_port,database_port + 10].

Range

1024–39989

Default Value

N/A

Response Parameters

Table 4 Parameter description

Parameter

Type

Description

job_id

String

Definition

Job ID.

Range

N/A

Example Request

Enabling M compatibility port and setting it to 3306
POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/1bb786201ae54b179b45c17e0f332f4bin14/mysql-compatibility
{ 
  "port" : 3306
}

Example Response

M compatibility port enabled.

{
	"job_id": "2b414788a6004883a02390e2eb0ea227"
}

Status Code

Error Code

For details, see Error Codes.