Property definition
Data source type: mysql
Supported configuration modes (ConnectionPropertiesMode):
Connection string mode (UrlMode)
Instance mode (InstanceMode)
Current-account instance mode
Parameter | Type | Example | Required | Description |
regionId | String | cn-shanghai | Yes | The ID of the region to which the instance belongs. |
instanceId | String | rm-xxxxxxxxx | Yes | The instance ID. |
database | String | mysql_database | Yes | The name of the database. |
username | String | xxxxx | Yes | The username. |
password | String | xxxxx | Yes | The password. |
securityProtocol | String | authTypeNone | No | The authentication type. Valid values:
|
truststoreFile | String | 1 | No | The ID of the truststore file. |
truststorePassword | String | apasara | No | The password of the truststore file. |
keystoreFile | String | 2 | No | The ID of the Keystore file. |
keystorePassword | String | apasara | No | The password of the Keystore file. |
driverVersion | String | 8.2.0 | No | The version of the driver. Valid values:
|
authType | String | PrimaryAccount | No | If you want to enable binary log reading from Object Storage Service (OSS), you must configure the authType parameter. Valid values:
|
authIdentity | String | 123456 | No | If you set the authType parameter to SubAccount, you must set the authIdentity parameter to the ID of a RAM user. If you set the authType parameter to RamRole, you must set the authIdentity parameter to the ID of a RAM role. You do not need to configure this parameter in the cross-account access scenario. |
readOnlyDBInstance | String | rm-uf65l3bwae8w8r35 | No | The ID of the secondary instance. |
envType | String | Dev | Yes | The information about the data source environment. Valid values:
|
Cross-account instance mode
Parameter | Type | Example | Required | Description |
regionId | String | cn-shanghai | Yes | The ID of the region to which the instance belongs. |
instanceId | String | rm-xxxxxxxxx | Yes | The instance ID. |
database | String | mysql_database | Yes | The name of the database. |
username | String | xxxxx | Yes | The username. |
password | String | xxxxx | Yes | The password. |
crossAccountOwnerId | String | 1 | Yes | The ID of another Alibaba Cloud account. |
crossAccountRoleName | String | mysql-role | Yes | The name of the RAM role assumed by another Alibaba Cloud account. |
securityProtocol | String | authTypeNone | No | The authentication type. Valid values:
|
truststoreFile | String | 1 | No | The ID of the truststore file. |
truststorePassword | String | apasara | No | The password of the truststore file. |
keystoreFile | String | 2 | No | The ID of the Keystore file. |
keystorePassword | String | apasara | No | The password of the Keystore file. |
driverVersion | String | 8.2.0 | No | The version of the driver. Valid values:
|
authType | String | PrimaryAccount | No | If you want to enable binary log reading from OSS, you must configure the authType parameter. Valid values:
|
readOnlyDBInstance | String | rm-uf65l3bwae8w8r35 | No | The ID of the secondary instance. |
envType | String | Dev | Yes | The information about the data source environment. Valid values:
|
Connection string mode
Parameter | Type | Example | Required | Description |
address | Array | | Yes | The address, which can contain one or more pairs of host and port. |
database | String | mysql_database | Yes | The name of the database. |
username | String | xxxxx | Yes | The username. |
password | String | xxxxx | Yes | The password. |
securityProtocol | String | authTypeNone | No | The authentication type. Valid values:
|
truststoreFile | String | 1 | No | The ID of the truststore file. |
truststorePassword | String | apasara | No | The password of the truststore file. |
keystoreFile | String | 2 | No | The ID of the Keystore file. |
keystorePassword | String | apasara | No | The password of the Keystore file. |
properties | JSON Object | | No | The properties of the driver. |
envType | String | Dev | Yes | The information about the data source environment. Valid values:
|
Configuration examples
Current-account instance mode
{
"instanceId": "rm-xxxxxxxxx",
"regionId": "cn-shanghai",
"database": "db",
"username": "aliyun",
"password": "xxx",
"securityProtocol": "authTypeNone",
"envType": "Dev"
}Cross-account instance mode
{
"instanceId": "rm-xxxxxxxxx",
"regionId": "cn-shanghai",
"database": "db",
"username": "aliyun",
"password": "xxx",
"crossAccountOwnerId": "1234567890",
"crossAccountRoleName": "my_ram_role",
"securityProtocol": "authTypeNone",
"envType": "Dev"
}Connection string mode
{
"address": [
{
"host": "127.0.0.1",
"port": 5432
}
],
"database": "db",
"properties": {
"connectTimeout": "2000"
},
"username": "aliyun",
"password": "xxx",
"envType": "Dev"
}