Registry /
azure / azure-mgmt-mysqlflexibleservers
The `azure-mgmt-mysqlflexibleservers` library provides a client for managing Azure Database for MySQL Flexible Servers. It enables Python developers to create, read, update, and delete MySQL Flexible Server resources including servers, databases, firewall rules, and configurations within an Azure subscription. The current version is 1.0.0, and it is part of the actively maintained Azure SDK for Python ecosystem.
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.925 runs
installs and imports cleanly · install 0.0s · import 0.654s · 46.9MB
glibcpy 3.10–3.925 runs
installs and imports cleanly · install 4.1s · import 0.582s · 47MB
46MB installed
● package 46MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MySQLManagementClient
✓ from azure.mgmt.mysqlflexibleservers import MySQLManagementClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then initialize `MySQLManagementClient` to interact with your Azure MySQL Flexible Servers. Ensure `AZURE_SUBSCRIPTION_ID` and other Azure Identity environment variables (like `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` for service principal authentication) are set for `DefaultAzureCredential` to function properly.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.mysqlflexibleservers import MySQLManagementClient
# Set environment variables for authentication:
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (for service principal)
# AZURE_SUBSCRIPTION_ID
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
# Authenticate using DefaultAzureCredential
# This credential type tries multiple authentication methods, like environment variables or managed identity.
credential = DefaultAzureCredential()
# Create a MySQLManagementClient instance
client = MySQLManagementClient(credential=credential, subscription_id=subscription_id)
# Example: List all MySQL Flexible Servers in the subscription
print(f"Listing MySQL Flexible Servers in subscription: {subscription_id}")
for server in client.servers.list():
print(f"- Server Name: {server.name}, Resource Group: {server.resource_group}")
# For more operations, use client.servers, client.databases, etc.
# e.g., print(client.servers.get(resource_group_name='myResourceGroup', server_name='myServerName'))
Debug
Known issues
breakingMigration from `azure-mgmt-rdbms`: The `azure-mgmt-rdbms` library's MySQL single server management is deprecated. Users should migrate to `azure-mgmt-mysqlflexibleservers` for managing MySQL Flexible Servers as soon as possible.fixUpdate your import statements and client initialization to use `azure-mgmt-mysqlflexibleservers` instead of `azure-mgmt-rdbms`.
affects: <= 0.2.0 (azure-mgmt-rdbms)
breakingAuthentication system revamp: Older credential mechanisms like `azure.common.credentials` or `msrestazure.azure_active_directory` are no longer supported across Azure SDKs.fixMigrate to `azure-identity` classes, specifically `DefaultAzureCredential`, for authentication. Ensure relevant environment variables (e.g., `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`) are configured.
affects: All versions
breakingModel `OperationProgressResult` instance variable `object_type` moved under `properties`; `Provisioning` model deleted. This introduces API changes in `1.0.0` compared to earlier beta versions.fixReview code that interacts with `OperationProgressResult` and adjust access to `object_type` if directly accessed. Remove any references to the `Provisioning` model.
affects: 1.0.0
gotchaTLS 1.0/1.1 connections denied: Azure Database for MySQL Flexible Server enforces TLS 1.2 by default. Older clients attempting to connect with TLS 1.0 or 1.1 will be denied.fixUpdate your client applications and drivers to support TLS 1.2 or higher. Verify your connection strings and client configurations.
affects: All versions
gotchaLack of `SUPER` privilege and `DBA` role: The Azure Database for MySQL Flexible Server service does not support `SUPER` privilege or `DBA` role. Operations requiring these privileges will fail.fixAdjust application logic to avoid operations that require `SUPER` privilege. Review and update stored procedures, triggers, or schema imports that might implicitly rely on these privileges.
affects: All versions
Audit
Dependencies
azure-identityrequiredRequired for Azure Active Directory token authentication.