Restart/Stop/Start an Azure Database for MySQL Flexible Server

[APPLIES TO: Azure Database for MySQL - Flexible Server

This article shows you how to perform restart, start and stop flexible server using Azure CLI.

Prerequisites

  • An Azure account with an active subscription.

    If you don't have an Azure subscription, create an Azure free account before you begin. With an Azure free account, you can now try Azure Database for MySQL - Flexible Server for free for 12 months. For more information, see Try Flexible Server for free.

  • Install or upgrade Azure CLI to the latest version. See Install Azure CLI.

  • Login to Azure account using az login command. Note the id property, which refers to Subscription ID for your Azure account.

    az login
    
  • If you have multiple subscriptions, choose the appropriate subscription in which you want to create the server using the az account set command. `

    az account set --subscription <subscription id>
    
  • Create a MySQL Flexible Server if you have not already created one using the az mysql flexible-server create command.

    az mysql flexible-server create --resource-group myresourcegroup --name myservername
    

Stop a running server

To stop a server, run az mysql flexible-server stop command. If you are using local context, you don't need to provide any arguments.

Usage:

az mysql flexible-server stop  [--name]
                               [--resource-group]
                               [--subscription]

Example without local context:

az mysql flexible-server stop  --resource-group --name myservername

Example with local context:

az mysql flexible-server stop

Start a stopped server

To start a server, run az mysql flexible-server start command. If you are using local context, you don't need to provide any arguments.

Usage:

az mysql flexible-server start [--name]
                               [--resource-group]
                               [--subscription]

Example without local context:

az mysql flexible-server start  --resource-group --name myservername

Example with local context:

az mysql flexible-server start

Important

Once the server has restarted successfully, all management operations are now available for the flexible server.

Restart a server

To restart a server, run az mysql flexible-server restart command. If you are using local context, you don't need to provide any arguments.

Note

If the user restarting the server is part of custom role the user should have write privilege on the server.

Usage:

az mysql flexible-server restart [--name]
                                 [--resource-group]
                                 [--subscription]

Example without local context:

az mysql flexible-server restart  --resource-group --name myservername

Example with local context:

az mysql flexible-server restart

Important

Once the server has restarted successfully, all management operations are now available for the flexible server.

Next steps