Azure Database for MySQL

Azure Database for MySQL is a managed relational database service based on the open-source MySQL Community Edition database engine. It allows you to focus on application innovation without needing to manage infrastructure, and offers highly available, scalable, and secure database solutions.

Tip: Azure Database for MySQL provides both Single Server and Flexible Server deployment options, each suited for different workloads and management preferences.

Key Features

Getting Started

1. Create an Azure Database for MySQL Server

You can create a new Azure Database for MySQL server through the Azure portal, Azure CLI, or programmatically.

Using Azure Portal:

  1. Sign in to the Azure portal.
  2. Click Create a resource.
  3. Search for "Azure Database for MySQL" and select it.
  4. Choose your deployment option (Single Server or Flexible Server).
  5. Fill in the required details: subscription, resource group, server name, administrator username and password, location, and version.
  6. Configure compute and storage settings based on your workload requirements.
  7. Review and create the server.

2. Connect to Your Server

Once your server is provisioned, you can connect to it using standard MySQL clients and tools.

Connection String Example:

ServerName: yourservername.mysql.database.azure.com
DatabaseName: your_database
UserName: your_admin_username@yourservername
Password: your_password
Port: 3306
SSL Mode: Preferred

You'll need to configure firewall rules in the Azure portal to allow access from your client IP address or virtual network.

3. Deploying Applications

Integrate Azure Database for MySQL with your applications hosted on Azure App Service, Azure Kubernetes Service, or virtual machines.

For most programming languages, you'll use a MySQL connector or driver. Refer to the official documentation for specific language examples (e.g., Python with SQLAlchemy, Node.js with `mysql` package).

Key Concepts

Pricing Tiers

Azure Database for MySQL offers three pricing tiers:

High Availability

Azure Database for MySQL provides various HA options to ensure your database remains accessible during planned maintenance or unplanned outages. This includes:

Security

Security is paramount. Azure Database for MySQL offers:

Important: Always use SSL/TLS connections to protect your data in transit. Configure firewall rules to restrict access only to necessary IP addresses.

Learn More