az mysql flexible-server

Manage Azure Database for MySQL Flexible Servers.

Commands

az mysql flexible-server connect

Connect to a flexible server.

az mysql flexible-server create

Create a MySQL flexible server.

az mysql flexible-server db

Manage MySQL databases on a flexible server.

az mysql flexible-server db create

Create a MySQL database on a flexible server.

az mysql flexible-server db delete

Delete a database on a flexible server.

az mysql flexible-server db list

List the databases for a flexible server.

az mysql flexible-server db show

Show the details of a database.

az mysql flexible-server delete

Delete a flexible server.

az mysql flexible-server deploy

Enable and run github action workflow for MySQL server.

az mysql flexible-server deploy run

Run an existing workflow in your github repository.

az mysql flexible-server deploy setup

Create github action workflow file for MySQL server.

az mysql flexible-server execute

Connect to a flexible server.

az mysql flexible-server firewall-rule

Manage firewall rules for a server.

az mysql flexible-server firewall-rule create

Create a new firewall rule for a flexible server.

az mysql flexible-server firewall-rule delete

Delete a firewall rule.

az mysql flexible-server firewall-rule list

List all firewall rules for a flexible server.

az mysql flexible-server firewall-rule show

Get the details of a firewall rule.

az mysql flexible-server firewall-rule update

Update a firewall rule.

az mysql flexible-server geo-restore

Geo-restore a flexible server from backup.

az mysql flexible-server list

List available flexible servers.

az mysql flexible-server list-skus

Lists available sku's in the given region.

az mysql flexible-server parameter

Commands for managing server parameter values for flexible server.

az mysql flexible-server parameter list

List the parameter values for a flexible server.

az mysql flexible-server parameter set

Update the parameter of a flexible server.

az mysql flexible-server parameter show

Get the parameter for a flexible server.".

az mysql flexible-server replica

Manage read replicas.

az mysql flexible-server replica create

Create a read replica for a server.

az mysql flexible-server replica list

List all read replicas for a given server.

az mysql flexible-server replica stop-replication

Stop replication to a read replica and make it a read/write server.

az mysql flexible-server restart

Restart a flexible server.

az mysql flexible-server restore

Restore a flexible server from backup.

az mysql flexible-server show

Get the details of a flexible server.

az mysql flexible-server show-connection-string

Show the connection strings for a MySQL flexible-server database.

az mysql flexible-server start

Start a flexible server.

az mysql flexible-server stop

Stop a flexible server.

az mysql flexible-server update

Update a flexible server.

az mysql flexible-server wait

Wait for the flexible server to satisfy certain conditions.

az mysql flexible-server connect

Connect to a flexible server.

az mysql flexible-server connect --admin-user
                                 --name
                                 [--admin-password]
                                 [--database-name]
                                 [--interactive]
                                 [--querytext]

Required Parameters

--admin-user -u

The login username of the administrator.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

Optional Parameters

--admin-password -p

The login password of the administrator.

--database-name -d

The name of a database.

--interactive

Pass this parameter to connect to database in interactive mode.

--querytext -q

A query to run against the flexible server.

az mysql flexible-server create

Create a MySQL flexible server.

Create a MySQL flexible server with custom or default configuration. For more information for network configuration, see

az mysql flexible-server create [--address-prefixes]
                                [--admin-password]
                                [--admin-user]
                                [--backup-retention]
                                [--database-name]
                                [--geo-redundant-backup {Disabled, Enabled}]
                                [--high-availability {Disabled, Enabled, SameZone, ZoneRedundant}]
                                [--iops]
                                [--location]
                                [--name]
                                [--private-dns-zone]
                                [--public-access]
                                [--resource-group]
                                [--sku-name]
                                [--standby-zone]
                                [--storage-auto-grow {Disabled, Enabled}]
                                [--storage-size]
                                [--subnet]
                                [--subnet-prefixes]
                                [--tags]
                                [--tier]
                                [--version]
                                [--vnet]
                                [--yes]
                                [--zone]

Examples

Create a MySQL flexible server with custom parameters

az mysql flexible-server create --location northeurope --resource-group testGroup \
  --name testserver --admin-user username --admin-password password \
  --sku-name Standard_B1ms --tier Burstable --public-access 0.0.0.0 --storage-size 32 \
  --tags "key=value" --version 5.7 --high-availability ZoneRedundant --zone 1 \
  --standby-zone 3 --storage-auto-grow Enabled --iops 500

Create a MySQL flexible server with default parameters and public access enabled by default. Resource group, server name, username, password, and default database will be created by CLI

az mysql flexible-server create

Create a MySQL flexible server with public access and add the range of IP address to have access to this server. The --public-access parameter can be 'All', 'None', <startIpAddress>, or <startIpAddress>-<endIpAddress>

az mysql flexible-server create --resource-group testGroup --name testserver --public-access 125.23.54.31-125.23.54.35

Create a MySQL flexible server with private access. If provided virtual network and subnet do not exists, virtual network and subnet with the specified address prefixes will be created.

az mysql flexible-server create --resource-group testGroup --name testserver --vnet myVnet --subnet mySubnet --address-prefixes 10.0.0.0/16 --subnet-prefixes 10.0.0.0/24

Create a MySQL flexible server using a new subnet resource ID and new private DNS zone resource ID. The subnet and DNS zone can be created in different subscription or resource group.

az mysql flexible-server create \
  --resource-group testGroup --name testserver \
  --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNetName}/subnets/{SubnetName} \
  --private-dns-zone /subscriptions/{SubID}/resourceGroups/{resourceGroup}/providers/Microsoft.Network/privateDnsZones/testMySQLFlexibleDnsZone.private.mysql.database.azure.com \
  --address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24

Create a MySQL flexible server using existing network resources in the same resource group. The provided subnet should not have any other resource deployed in it and this subnet will be delegated to Microsoft.DBforMySQL/flexibleServers, if not already delegated. The private DNS zone will be linked to the virtual network if not already linked.

# create vnet
az network vnet create --resource-group testGroup --name testVnet --location testLocation --address-prefixes 172.0.0.0/16

# create subnet
az network vnet subnet create --resource-group testGroup --vnet-name testVnet --address-prefixes 172.0.0.0/24 --name testSubnet

# create private dns zone
az network private-dns zone create -g testGroup -n testDNS.private.mysql.database.azure.com

az mysql flexible-server create --resource-group testGroup \
  --name testserver --location testLocation \
  --subnet /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \
  --private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.mysql.database.azure.com\


az mysql flexible-server create --resource-group testGroup --name testserver \
  --vnet testVnet --subnet testSubnet --location testLocation \
  --private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.mysql.database.azure.com

Create a MySQL flexible server using existing network resources in the different resource group / subscription.

az mysql flexible-server create --resource-group testGroup \
   --name testserver --location testLocation \
  --subnet /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \
  --private-dns-zone /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/privateDnsZones/testDNS.mysql.database.azure.com

Optional Parameters

--address-prefixes

The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.

--admin-password -p

The password of the administrator. 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.

--admin-user -u

Administrator username for the server. Once set, it cannot be changed.

default value: juniorwidgeon6
--backup-retention

The number of days a backup is retained. Range of 1 to 35 days. Default is 7 days.

default value: 7
--database-name -d

The name of the database to be created when provisioning the database server.

--geo-redundant-backup

Whether or not geo redundant backup is enabled.

accepted values: Disabled, Enabled
default value: Disabled
--high-availability

Enable (ZoneRedundant or SameZone) or disable high availability feature. Default value is Disabled. High availability can only be set during flexible server create time.

accepted values: Disabled, Enabled, SameZone, ZoneRedundant
default value: Disabled
--iops

Number of IOPS to be allocated for this server. You will get certain amount of free IOPS based on compute and storage provisioned. The default value for IOPS is free IOPS. To learn more about IOPS based on compute and storage, refer to IOPS in Azure Database for MySQL Flexible Server.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--private-dns-zone

This parameter only applies for a server with private access. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.

--public-access

Determines the public access. Enter single or range of IP addresses to be included in the allowed list of IPs. IP address ranges must be dash-separated and not contain any spaces. Specifying 0.0.0.0 allows public access from any resources deployed within Azure to access your server. Setting it to "None" sets the server in public access mode but does not create a firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--sku-name

The name of the compute SKU. Follows the convention Standard_{VM name}. Examples: Standard_D4s_v3.

default value: Standard_B1ms
--standby-zone

The availability zone information of the standby server when high availability is enabled.

--storage-auto-grow

Enable or disable autogrow of the storage. Default value is Enabled.

accepted values: Disabled, Enabled
default value: Enabled
--storage-size

The storage capacity of the server. Minimum is 32 GiB and max is 16 TiB.

default value: 32
--subnet

Name or resource ID of a new or existing subnet. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.

--subnet-prefixes

The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--tier

Compute tier of the server. Accepted values: Burstable, GeneralPurpose, Memory Optimized.

default value: Burstable
--version

Server major version.

default value: 5.7
--vnet

Name or ID of a new or existing virtual network. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.

--yes -y

Do not prompt for confirmation.

--zone -z

Availability zone into which to provision the resource.

az mysql flexible-server delete

Delete a flexible server.

az mysql flexible-server delete [--ids]
                                [--name]
                                [--resource-group]
                                [--yes]

Examples

Delete a flexible server.

az mysql flexible-server delete --resource-group testGroup --name testserver

Delete a flexible server without confirmation prompt.

az mysql flexible-server delete --resource-group testGroup --name testserver --yes

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--yes -y

Do not prompt for confirmation.

az mysql flexible-server execute

Connect to a flexible server.

az mysql flexible-server execute --admin-password
                                 --admin-user
                                 --name
                                 [--database-name]
                                 [--file-path]
                                 [--querytext]

Required Parameters

--admin-password -p

The login password of the administrator.

--admin-user -u

The login username of the administrator.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

Optional Parameters

--database-name -d

The name of a database.

--file-path -f

The path of the sql file to execute.

--querytext -q

A query to run against the flexible server.

az mysql flexible-server geo-restore

Geo-restore a flexible server from backup.

az mysql flexible-server geo-restore --location
                                     --source-server
                                     [--address-prefixes]
                                     [--ids]
                                     [--name]
                                     [--no-wait]
                                     [--private-dns-zone]
                                     [--public-access {Disabled, Enabled}]
                                     [--resource-group]
                                     [--subnet]
                                     [--subnet-prefixes]
                                     [--vnet]
                                     [--yes]
                                     [--zone]

Examples

Geo-restore 'testserver' to a new server 'testserverNew' in location 'newLocation' with the same network configuration. Private access server will use different private dns zone.

az mysql flexible-server geo-restore --resource-group testGroup --name testserverNew --source-server testserver --location newLocation

Geo-estore public access or private access server 'testserver' as a new server 'testserverNew' with new subnet. New vnet, subnet, and private dns zone for the restored server will be provisioned. Please refer to 'flexible-server create' command for more private access scenarios.

az mysql flexible-server geo-restore --resource-group testGroup --name testserverNew \
  --source-server testserver --vnet newVnet --subnet newSubnet \
  --address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24 \
  --private-dns-zone testDNS.mysql.database.azure.com --location newLocation

Gep-estore private access server 'testserver' as a new server 'testserverNew' with public access.

az mysql flexible-server geo-restore --resource-group testGroup --name testserverNew  --source-server testserver --public-access Enabled --location newLocation

Required Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--source-server

The name or resource ID of the source server to restore from.

Optional Parameters

--address-prefixes

The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--no-wait

Do not wait for the long-running operation to finish.

--private-dns-zone

This parameter only applies for a server with private access. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.

--public-access

Determines the public access.

accepted values: Disabled, Enabled
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subnet

Name or resource ID of a new or existing subnet. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.

--subnet-prefixes

The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.

--vnet

Name or ID of a new or existing virtual network. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.

--yes -y

Do not prompt for confirmation.

--zone -z

Availability zone into which to provision the resource.

az mysql flexible-server list

List available flexible servers.

az mysql flexible-server list [--resource-group]

Examples

List all MySQL flexible servers in a subscription.

az mysql flexible-server list

List all MySQL flexible servers in a resource group.

az mysql flexible-server list --resource-group testGroup

List all MySQL flexible servers in a resource group in table format.

az mysql flexible-server list --resource-group testGroup --output table

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az mysql flexible-server list-skus

Lists available sku's in the given region.

az mysql flexible-server list-skus --location

Examples

Lists available sku's in the given region.

az mysql flexible-server list-skus -l eastus

Lists available sku's in the given region in table output

az mysql flexible-server list-skus -l eastus -o table

Required Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

az mysql flexible-server restart

Restart a flexible server.

az mysql flexible-server restart [--failover]
                                 [--ids]
                                 [--name]
                                 [--resource-group]

Examples

Restart a flexible server.

az mysql flexible-server restart --resource-group testGroup --name testserver

Restart a flexible server with failover

az mysql flexible-server restart --resource-group testGroup --name testserver --failover Forced

Optional Parameters

--failover

Forced failover for server restart operation. Allowed values: Forced.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az mysql flexible-server restore

Restore a flexible server from backup.

az mysql flexible-server restore --source-server
                                 [--address-prefixes]
                                 [--ids]
                                 [--name]
                                 [--no-wait]
                                 [--private-dns-zone]
                                 [--public-access {Disabled, Enabled}]
                                 [--resource-group]
                                 [--restore-time]
                                 [--subnet]
                                 [--subnet-prefixes]
                                 [--vnet]
                                 [--yes]
                                 [--zone]

Examples

Restore 'testserver' to a specific point-in-time as a new server 'testserverNew' with the same network configuration.

az mysql flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver --restore-time "2017-06-15T13:10:00Z"

Restore public access or private access server 'testserver' as a new server 'testserverNew' with new subnet to current point-in-time. New vnet, subnet, and private dns zone for the restored server will be provisioned. Please refer to 'flexible-server create' command for more private access scenarios.

az mysql flexible-server restore --resource-group testGroup --name testserverNew \
  --source-server testserver --vnet newVnet --subnet newSubnet \
  --address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24 \
  --private-dns-zone testDNS.mysql.database.azure.com

Restore private access server 'testserver' to current point-in-time as a new server 'testserverNew' with public access.

az mysql flexible-server restore --resource-group testGroup --name testserverNew \
  --source-server testserver --public-access Enabled

Required Parameters

--source-server

The name or resource ID of the source server to restore from.

Optional Parameters

--address-prefixes

The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--no-wait

Do not wait for the long-running operation to finish.

--private-dns-zone

This parameter only applies for a server with private access. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.

--public-access

Determines the public access.

accepted values: Disabled, Enabled
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--restore-time

The point in time in UTC to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+00:00The default value is set to current time.

default value: 2022-05-16T13:29:42+00:00
--subnet

Name or resource ID of a new or existing subnet. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.

--subnet-prefixes

The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.

--vnet

Name or ID of a new or existing virtual network. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.

--yes -y

Do not prompt for confirmation.

--zone -z

Availability zone into which to provision the resource.

az mysql flexible-server show

Get the details of a flexible server.

az mysql flexible-server show [--ids]
                              [--name]
                              [--resource-group]

Examples

Get the details of a flexible server

az mysql flexible-server show --resource-group testGroup --name testserver

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az mysql flexible-server show-connection-string

Show the connection strings for a MySQL flexible-server database.

az mysql flexible-server show-connection-string [--admin-password]
                                                [--admin-user]
                                                [--database-name]
                                                [--ids]
                                                [--server-name]

Examples

Show connection strings for cmd and programming languages.

az mysql flexible-server show-connection-string -s testserver -u username -p password -d databasename

Optional Parameters

--admin-password -p

The password of the administrator. 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.

default value: {password}
--admin-user -u

Administrator username for the server. Once set, it cannot be changed.

default value: {login}
--database-name -d

The name of the database to be created when provisioning the database server.

default value: {database}
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--server-name -s

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

default value: {server}

az mysql flexible-server start

Start a flexible server.

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

Examples

Start a flexible server.

az mysql flexible-server start --resource-group testGroup --name testserver

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az mysql flexible-server stop

Stop a flexible server.

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

Examples

Stop a flexible server.

az mysql flexible-server stop --resource-group testGroup --name testserver

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az mysql flexible-server update

Update a flexible server.

az mysql flexible-server update [--add]
                                [--admin-password]
                                [--backup-retention]
                                [--force-string]
                                [--high-availability {Disabled, Enabled, SameZone, ZoneRedundant}]
                                [--ids]
                                [--iops]
                                [--maintenance-window]
                                [--name]
                                [--remove]
                                [--replication-role]
                                [--resource-group]
                                [--set]
                                [--sku-name]
                                [--standby-zone]
                                [--storage-auto-grow {Disabled, Enabled}]
                                [--storage-size]
                                [--tags]
                                [--tier]

Examples

Update a flexible server's sku, using local context for server and resource group.

az mysql flexible-server update --sku-name Standard_D4ds_v4 --tier GeneralPurpose

Update a flexible server's tags.

az mysql flexible-server update --resource-group testGroup --name testserver --tags "k1=v1" "k2=v2"

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--admin-password -p

The password of the administrator. 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.

--backup-retention

The number of days a backup is retained. Range of 1 to 35 days. Default is 7 days.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--high-availability

Enable (ZoneRedundant or SameZone) or disable high availability feature. Default value is Disabled. High availability can only be set during flexible server create time.

accepted values: Disabled, Enabled, SameZone, ZoneRedundant
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--iops

Number of IOPS to be allocated for this server. You will get certain amount of free IOPS based on compute and storage provisioned. The default value for IOPS is free IOPS. To learn more about IOPS based on compute and storage, refer to IOPS in Azure Database for MySQL Flexible Server.

--maintenance-window

Period of time (UTC) designated for maintenance. Examples: "Sun:23:30" to schedule on Sunday, 11:30pm UTC. To set back to default pass in "Disabled".

--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--replication-role

The replication role of the server.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--sku-name

The name of the compute SKU. Follows the convention Standard_{VM name}. Examples: Standard_D4s_v3.

--standby-zone

The availability zone information of the standby server when high availability is enabled.

--storage-auto-grow

Enable or disable autogrow of the storage. Default value is Enabled.

accepted values: Disabled, Enabled
--storage-size

The storage capacity of the server. Minimum is 32 GiB and max is 16 TiB.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--tier

Compute tier of the server. Accepted values: Burstable, GeneralPurpose, Memory Optimized.

az mysql flexible-server wait

Wait for the flexible server to satisfy certain conditions.

az mysql flexible-server wait [--created]
                              [--custom]
                              [--deleted]
                              [--exists]
                              [--ids]
                              [--interval]
                              [--name]
                              [--resource-group]
                              [--timeout]
                              [--updated]

Examples

Wait for the flexible server to satisfy certain conditions.

az mysql flexible-server wait --exists --resource-group testGroup --name testserver

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--interval

Polling interval in seconds.

default value: 30
--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.