参数名 | 必填项 | 类型 | 介绍 |
Zone | 是 | string | 可用区 ID,当前支持 ap-shanghai-2、ap-beijing-3、ap-guangzhou-2。 |
DBInstanceName | 是 | string | 数据库实例名,同一个帐号下该值必须唯一。 |
DBVersion | 是 | string | 数据库版本,目前仅支持10.4。 |
DBCharset | 是 | string | PostgreSQL 数据库字符集,目前支持 UTF8、LATIN1 两种。 |
VpcId | 否 | string | 私有网络 ID,若不指定此项,则为实例分配基础网络 IP 地址。 |
SubnetId | 否 | string | 私有网络子网 ID,与私有网络 ID 同时搭配使用。 |
{"Response": {"RequestId": "20304c-6fd7-4427-8e09-2b081e1","DBInstanceId": "postgres-xxxxxxx"}}
{"Response": {"TotalCount": 1,"DBInstanceSet": [{"DBInstanceId": "postgres-xxxxxxx","DBInstanceName": "test","DBInstanceStatus": "running",#数据库实例状态"Region": "ap-shanghai","Zone": "ap-shanghai-2","ProjectId": 0,"VpcId": "vpc-test","SubnetId": "subnet-test","DBCharset": "UTF8","DBVersion": "10.4","CreateTime": "2020-03-23 11:43:56","DBInstanceNetInfo": [{"Address": "","Ip": "10.1.1.2", #IP 为示例,同一私有网络,子网内可访问"Port": 5432, #连接端口"Status": "opened","NetType": "private"},{"Address": "","Ip": "","Port": 0,"Status": "0","NetType": "public"}],"DBAccountSet": [{"DBUser": "tencentdb_xxxxxxx","DBPassword": "**************",#数据库密码,请根据实际情况获取,当修改过密码后,此接口返回的密码将不可使用"DBConnLimit": 100}],"DBDatabaseList": ["tencentdb_xxxxxxx"]}],"RequestId": "89583d-cfdd-4db1-bd32-64eb1dbfa"}}
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpmyum install postgresql10 postgresql10.x86_64
psql -U 数据库用户 -h IP地址 -p 端口
tencentdb_xx>
说明连接成功。
本页内容是否解决了您的问题?