Migrate to Innovate Summit:
Learn how migrating and modernizing to Azure can boost your business's performance, resilience, and security, enabling you to fully embrace AI.Register now
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Manage Azure Database for MySQL - Flexible Server using the Azure CLI
Article
This article shows you how to manage your Azure Database for MySQL Flexible Server instance deployed in Azure. Management tasks include compute and storage scaling, admin password reset, and viewing server details.
This article requires that you're running the Azure CLI version 2.0 or later locally. To see the version installed, run the az --version command. If you need to install or upgrade, see Install Azure CLI.
You'll need to log in to your account using the az login command. Note the id property, which refers to Subscription ID for your Azure account.
Azure CLI
az login
Select the specific subscription under your account using az account set command. Make a note of the id value from the az login output to use as the value for subscription argument in the command. If you have multiple subscriptions, choose the appropriate subscription in which the resource should be billed. To get all your subscription, use az account list.
Azure CLI
az account set --subscription<subscription id>
Important
If you have not already created a Flexible Server yet, please create one to get started with this how to guide.
Scale compute and storage
You can scale up your compute tier, vCores, and storage easily using the following command. You can see all the server operation you can perform az mysql flexible-server update
Azure CLI
az mysql flexible-server update --resource-group myresourcegroup --name mydemoserver --sku-name Standard_D4ds_v4 --storage-size6144
Here are the details for arguments above :
Setting
Sample value
Description
name
mydemoserver
Enter a unique name for your Azure Database for MySQL server. The server name can contain only lowercase letters, numbers, and the hyphen (-) character. It must contain from 3 to 63 characters.
resource-group
myresourcegroup
Provide the name of the Azure resource group.
sku-name
Standard_D4ds_v4
Enter the name of the compute tier and size. Follows the convention Standard_{VM size} in shorthand. See the pricing tiers for more information.
storage-size
6144
The storage capacity of the server (unit is megabytes). Minimum 5120 and increases in 1024 increments.
Important
Storage can be scaled up (however, you cannot scale storage down)
Manage MySQL databases on a server.
You can use any of these commands to create, delete , list and view database properties of a database on your server
az mysql flexible-server db show -g myresourcegroup -s mydemoserver -n mydatabasename
Shows more details of the database
Update admin password
You can change the administrator role's password with this command
Azure CLI
az mysql flexible-server update --resource-group myresourcegroup --name mydemoserver --admin-password<new-password>
Important
Make sure password is minimum 8 characters and maximum 128 characters.
Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.
Microsoft Azure Database for MySQL is an Azure managed data service. It considerably simplifies database deployment, management, and maintenance, while providing compatibility with existing MySQL database workloads.
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.