{"id":1931,"library":"azure-mgmt-mysqlflexibleservers","title":"Azure MySQL Flexible Servers Management Client Library for Python","description":"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.","status":"active","version":"1.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/mysql/azure-mgmt-mysqlflexibleservers","tags":["Azure","Cloud","MySQL","Database","Management","SDK"],"install":[{"cmd":"pip install azure-mgmt-mysqlflexibleservers azure-identity","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Required for Azure Active Directory token authentication.","package":"azure-identity","optional":false}],"imports":[{"symbol":"MySQLManagementClient","correct":"from azure.mgmt.mysqlflexibleservers import MySQLManagementClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.mysqlflexibleservers import MySQLManagementClient\n\n# Set environment variables for authentication:\n# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (for service principal)\n# AZURE_SUBSCRIPTION_ID\n\nsubscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')\n\n# Authenticate using DefaultAzureCredential\n# This credential type tries multiple authentication methods, like environment variables or managed identity.\ncredential = DefaultAzureCredential()\n\n# Create a MySQLManagementClient instance\nclient = MySQLManagementClient(credential=credential, subscription_id=subscription_id)\n\n# Example: List all MySQL Flexible Servers in the subscription\nprint(f\"Listing MySQL Flexible Servers in subscription: {subscription_id}\")\nfor server in client.servers.list():\n    print(f\"- Server Name: {server.name}, Resource Group: {server.resource_group}\")\n\n# For more operations, use client.servers, client.databases, etc.\n# e.g., print(client.servers.get(resource_group_name='myResourceGroup', server_name='myServerName'))","lang":"python","description":"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."},"warnings":[{"fix":"Update your import statements and client initialization to use `azure-mgmt-mysqlflexibleservers` instead of `azure-mgmt-rdbms`.","message":"Migration 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.","severity":"breaking","affected_versions":"<= 0.2.0 (azure-mgmt-rdbms)"},{"fix":"Migrate 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.","message":"Authentication system revamp: Older credential mechanisms like `azure.common.credentials` or `msrestazure.azure_active_directory` are no longer supported across Azure SDKs.","severity":"breaking","affected_versions":"All versions"},{"fix":"Review code that interacts with `OperationProgressResult` and adjust access to `object_type` if directly accessed. Remove any references to the `Provisioning` model.","message":"Model `OperationProgressResult` instance variable `object_type` moved under `properties`; `Provisioning` model deleted. This introduces API changes in `1.0.0` compared to earlier beta versions.","severity":"breaking","affected_versions":"1.0.0"},{"fix":"Update your client applications and drivers to support TLS 1.2 or higher. Verify your connection strings and client configurations.","message":"TLS 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Adjust 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.","message":"Lack 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}