You need to enable JavaScript to run this app.
RDS for MySQL

RDS for MySQL

Copy page
Download PDF
Python SDK
Initializing the client
Copy page
Download PDF
Initializing the client
The MySQL Python client provides a series of interfaces to interact with the MySQL service and manage MySQL Database resources. You need to initialize the MySQL Python client before you can send HTTP/HTTPS requests to the MySQL service. This topic describes how to initialize the MySQL Python client.​
Prerequisites​
  • A Volcano Engine account has been registered with real name authentication completed. For specific steps, refer to Create account and Verify account.​
  • The Access Key ID (AK) and Secret Access Key (SK) of the account have been obtained. For instructions, refer to View AKSK information.​
  • The regions supported by RDS for MySQL have been obtained. Refer to Service Address.​
Initializing the client​
Use the following code to initialize the client.​
​
import volcenginesdkrdsmysqlv2​
import volcenginesdkcore​
from volcenginesdkcore.rest import ApiException​
​
if __name__ == "__main__":​
configuration = volcenginesdkcore.Configuration()​
# 设置 AKSK 验证信息及 Region​
configuration.ak = "Your AK"​
configuration.sk = "Your SK"​
configuration.region = "Your Region"​
​
try:​
# 创建 RDS MySQL SDK 客户端,接口调用均需要通过此客户端执行​
api_instance = volcenginesdkrdsmysqlv2.RDSMYSQLV2Api(volcenginesdkcore.ApiClient(configuration))​
except ApiException as e:​
print("Exception: %s\n" % e)​
​
​
​
Last updated: 2025.12.04 11:25:46