TiDB
Updated at:
Configure a TiDB data source in DataWorks using the connection string pattern (UrlMode).
Property definitions
-
Data source type:
tidb -
Supported
ConnectionPropertiesMode:UrlMode
Connection string pattern
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
address |
JSONArray | Yes | — | The host and port of the TiDB instance. Only a single host address and a single port are supported. |
database |
String | Yes | — | The database name. |
username |
String | Yes | — | The username. |
password |
String | Yes | — | The password. |
properties |
JSON Object | No | — | The driver properties. Example: {"queryTimeout":"1000"}. |
securityProtocol |
String | No | authTypeNone |
The SSL authentication mode. Valid values: authTypeNone (no SSL), authTypeSsl (enable SSL). |
truststoreFile |
String | No | — | The truststore certificate file (reference). Required when securityProtocol is authTypeSsl. |
truststorePassword |
String | No | — | The truststore password. Required when securityProtocol is authTypeSsl. |
keystoreFile |
String | No | — | The keystore certificate file (reference). |
keystorePassword |
String | No | — | The keystore password. |
envType |
String | Yes | — | The environment context. Valid values: Dev (development), Prod (production). |
Configuration example
Connection string pattern
The following example configures a TiDB data source using the connection string pattern (UrlMode).
{
"envType": "Prod",
"securityProtocol": "authTypeNone",
"address": [
{
"host": "127.0.0.1",
"port": 5432
}
],
"database": "db",
"properties": {
"queryTimeout": "2000"
},
"username": "aliyun",
"password": "xxx"
}
Is this page helpful?