Share via


az mysql flexible-server

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Manage Azure Database for MySQL Flexible Servers.

Commands

Name Description Type Status
az mysql flexible-server ad-admin

Manage server Active Directory administrator.

Core GA
az mysql flexible-server ad-admin create

Create an Active Directory administrator.

Core GA
az mysql flexible-server ad-admin delete

Delete an Active Directory administrator.

Core GA
az mysql flexible-server ad-admin list

List all Active Directory administrators.

Core GA
az mysql flexible-server ad-admin show

Get an Active Directory administrator.

Core GA
az mysql flexible-server ad-admin wait

Wait for the Active Directory administrator to satisfy certain conditions.

Core GA
az mysql flexible-server advanced-threat-protection-setting

Manage the server's advanced threat protection setting.

Core GA
az mysql flexible-server advanced-threat-protection-setting show

Get the server's advanced threat protection setting.

Core GA
az mysql flexible-server advanced-threat-protection-setting update

Update the server's advanced threat protection setting.

Core GA
az mysql flexible-server backup

Manage flexible server backups.

Core GA
az mysql flexible-server backup create

Create a backup for a given server with specified backup name.

Core GA
az mysql flexible-server backup list

List all the backups for a given server.

Core GA
az mysql flexible-server backup show

Show the details of a specific backup for a given server.

Core GA
az mysql flexible-server connect

Connect to a flexible server.

Extension GA
az mysql flexible-server create

Create a MySQL flexible server.

Core GA
az mysql flexible-server db

Manage MySQL databases on a flexible server.

Core GA
az mysql flexible-server db create

Create a MySQL database on a flexible server.

Core GA
az mysql flexible-server db delete

Delete a database on a flexible server.

Core GA
az mysql flexible-server db list

List the databases for a flexible server.

Core GA
az mysql flexible-server db show

Show the details of a database.

Core GA
az mysql flexible-server delete

Delete a flexible server.

Core GA
az mysql flexible-server deploy

Enable and run GitHub Actions workflow for MySQL server.

Core GA
az mysql flexible-server deploy run

Run an existing workflow in your github repository.

Core GA
az mysql flexible-server deploy setup

Create GitHub Actions workflow file for MySQL server.

Core GA
az mysql flexible-server detach-vnet

Detach vnet for a flexible server.

Core GA
az mysql flexible-server execute

Connect to a flexible server.

Extension GA
az mysql flexible-server export

Manage export backup on a server.

Core Preview
az mysql flexible-server export create

Create an export backup for a given server with specified backup name.

Core Preview
az mysql flexible-server firewall-rule

Manage firewall rules for a server.

Core GA
az mysql flexible-server firewall-rule create

Create a new firewall rule for a flexible server.

Core GA
az mysql flexible-server firewall-rule delete

Delete a firewall rule.

Core GA
az mysql flexible-server firewall-rule list

List all firewall rules for a flexible server.

Core GA
az mysql flexible-server firewall-rule show

Get the details of a firewall rule.

Core GA
az mysql flexible-server firewall-rule update

Update a firewall rule.

Core GA
az mysql flexible-server geo-restore

Geo-restore a flexible server from backup.

Core GA
az mysql flexible-server gtid

Manage GTID on a server.

Core GA
az mysql flexible-server gtid reset

Resets GTID on a server.

Core GA
az mysql flexible-server identity

Manage server user assigned identities.

Core GA
az mysql flexible-server identity assign

Add user asigned managed identities to the server.

Core GA
az mysql flexible-server identity list

List all user assigned managed identities from the server.

Core GA
az mysql flexible-server identity remove

Remove user asigned managed identites from the server.

Core GA
az mysql flexible-server identity show

Get an user assigned managed identity from the server.

Core GA
az mysql flexible-server import

Manage import workflows for MySQL Flexible Servers.

Core GA
az mysql flexible-server import create

Create a new import workflow for flexible server.

Core GA
az mysql flexible-server import stop-replication

To stop replication between the source single server and target flexible server.

Core GA
az mysql flexible-server list

List available flexible servers.

Core GA
az mysql flexible-server list-skus

Lists available sku's in the given region.

Core GA
az mysql flexible-server maintenance

Manage maintenance on a flexible server.

Core GA
az mysql flexible-server maintenance list

List all of the maintenances of a flexible server.

Core GA
az mysql flexible-server maintenance reschedule

Reschedule the ongoing planned maintenance of a flexible server.

Core GA
az mysql flexible-server maintenance show

Get the specific maintenance of a flexible server by maintenance name.

Core GA
az mysql flexible-server parameter

Commands for managing server parameter values for flexible server.

Core GA
az mysql flexible-server parameter list

List the parameter values for a flexible server.

Core GA
az mysql flexible-server parameter set

Update the parameter of a flexible server.

Core GA
az mysql flexible-server parameter set-batch

Batch update parameters of a flexible server.

Core GA
az mysql flexible-server parameter show

Get the parameter for a flexible server.".

Core GA
az mysql flexible-server replica

Manage read replicas.

Core GA
az mysql flexible-server replica create

Create a read replica for a server.

Core GA
az mysql flexible-server replica list

List all read replicas for a given server.

Core GA
az mysql flexible-server replica stop-replication

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

Core GA
az mysql flexible-server restart

Restart a flexible server.

Core GA
az mysql flexible-server restore

Restore a flexible server from backup.

Core GA
az mysql flexible-server server-logs

Manage server logs.

Core GA
az mysql flexible-server server-logs download

Download log files.

Core GA
az mysql flexible-server server-logs list

List log files for a server.

Core GA
az mysql flexible-server show

Get the details of a flexible server.

Core GA
az mysql flexible-server show-connection-string

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

Core GA
az mysql flexible-server start

Start a flexible server.

Core GA
az mysql flexible-server stop

Stop a flexible server.

Core GA
az mysql flexible-server update

Update a flexible server.

Core GA
az mysql flexible-server upgrade

Upgrade the major version of a flexible server.

Core GA
az mysql flexible-server wait

Wait for the flexible server to satisfy certain conditions.

Core GA

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.

Property Value
Parameter group: Authentication 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.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--admin-password -p

The login password of the administrator.

Property Value
Parameter group: Authentication Arguments
--database-name -d

The name of a database.

--interactive

Pass this parameter to connect to database in interactive mode.

--querytext -q
Deprecated

Argument 'querytext' has been deprecated and will be removed in a future release. Use 'execute' instead.

A query to run against the flexible server.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

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 [--accelerated-logs {Disabled, Enabled}]
                                [--address-prefixes]
                                [--admin-password]
                                [--admin-user]
                                [--auto-scale-iops {Disabled, Enabled}]
                                [--backup-identity]
                                [--backup-interval]
                                [--backup-key]
                                [--backup-retention]
                                [--database-name]
                                [--database-port]
                                [--geo-redundant-backup {Disabled, Enabled}]
                                [--high-availability {Disabled, SameZone, ZoneRedundant}]
                                [--identity]
                                [--iops]
                                [--key]
                                [--___location]
                                [--maintenance-policy-patch-strategy --patch-strategy {Regular, VirtualCanary}]
                                [--name]
                                [--private-dns-zone]
                                [--public-access]
                                [--resource-group]
                                [--sku-name]
                                [--standby-zone]
                                [--storage-auto-grow {Disabled, Enabled}]
                                [--storage-redundancy {LocalRedundancy, ZoneRedundancy}]
                                [--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

Create a MySQL flexible server with data encryption.

# create keyvault
az keyvault create -g testGroup -n testVault --___location testLocation \
  --enable-purge-protection true


# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \
  --vault-name testVault --query key.kid -o tsv)


# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \
  --___location testLocation --query principalId -o tsv)


# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \
  --key-permissions wrapKey unwrapKey get list


# create flexible server with data encryption enabled
az mysql flexible-server create -g testGroup -n testServer --___location testLocation \
  --key $keyIdentifier --identity testIdentity

Create a MySQL flexible server with geo redundant backup and data encryption.

# create keyvault
az keyvault create -g testGroup -n testVault --___location testLocation \
  --enable-purge-protection true


# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \
  --vault-name testVault --query key.kid -o tsv)


# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \
  --___location testLocation --query principalId -o tsv)


# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \
  --key-permissions wrapKey unwrapKey get list


# create backup keyvault
az keyvault create -g testGroup -n testBackupVault --___location testBackupLocation \
  --enable-purge-protection true


# create backup key in backup keyvault and save its key identifier
backupKeyIdentifier=$(az keyvault key create --name testBackupKey -p software \
  --vault-name testBackupVault --query key.kid -o tsv)


# create backup identity and save its principalId
backupIdentityPrincipalId=$(az identity create -g testGroup --name testBackupIdentity \
  --___location testBackupLocation --query principalId -o tsv)


# add testBackupIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testBackupVault
az keyvault set-policy -g testGroup -n testBackupVault \
  --object-id $backupIdentityPrincipalId --key-permissions wrapKey unwrapKey get list


# create flexible server with geo redundant backup and data encryption enabled
az mysql flexible-server create -g testGroup -n testServer --___location testLocation \
  --geo-redundant-backup Enabled \
  --key $keyIdentifier --identity testIdentity \
  --backup-key $backupKeyIdentifier --backup-identity testBackupIdentity

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-logs

Enable or disable accelerated logs. Only support for Business Critical tier. Default value is Enabled.

Property Value
Accepted values: Disabled, Enabled
--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.

Property Value
Parameter group: Authentication Arguments
--admin-user -u

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

Property Value
Parameter group: Authentication Arguments
Default value: sinfulauk1
--auto-scale-iops

Enable or disable the auto scale iops. Default value is Enabled.

Property Value
Default value: Enabled
Accepted values: Disabled, Enabled
--backup-identity

The name or resource ID of the geo backup user identity for data encryption. The identity needs to be in the same region as the backup region.

--backup-interval

The interval between backups in hours. Accepted values are 24, 12 and 6. The default value is 24.

--backup-key

The resource ID of the geo backup keyvault key for data encryption. The key needs to be in the same region as the backup region.

--backup-retention

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

Property Value
Default value: 7
--database-name -d

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

--database-port

The port of the database. Default value is 3306.

--geo-redundant-backup

Whether or not geo redundant backup is enabled.

Property Value
Default value: Disabled
Accepted values: Disabled, Enabled
--high-availability

Enable (ZoneRedundant or SameZone) or disable high availability feature.

Property Value
Default value: Disabled
Accepted values: Disabled, SameZone, ZoneRedundant
--identity

The name or resource ID of the user assigned identity for data encryption.

--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.

--key

The resource ID of the primary keyvault key for data encryption.

--___location -l

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

--maintenance-policy-patch-strategy --patch-strategy

The patch strategy of maintenance policy. Accepted values: Regular, VirtualCanary. Default value is Regular.

Property Value
Accepted values: Regular, VirtualCanary
--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 if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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_B1ms.

Property Value
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.

Property Value
Default value: Enabled
Accepted values: Disabled, Enabled
--storage-redundancy

Enable local redundancy or zone redundancy. Zone redundancy only supports Business Critical tier.

Property Value
Accepted values: LocalRedundancy, ZoneRedundancy
--storage-size

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

Property Value
Default value: 32
--subnet

Name or resource ID of a new or existing subnet. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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, MemoryOptimized.

Property Value
Default value: Burstable
--version

Server major version.

Property Value
Default value: 8.0.21
--vnet

Name or ID of a new or existing virtual network. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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.

Property Value
Default value: False
--zone -z

Availability zone into which to provision the resource.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server delete

Delete a flexible server.

az mysql flexible-server delete [--ids]
                                [--name]
                                [--resource-group]
                                [--subscription]
                                [--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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server detach-vnet

Detach vnet for a flexible server.

az mysql flexible-server detach-vnet --public-network-access {Disabled, Enabled}
                                     [--ids]
                                     [--name]
                                     [--resource-group]
                                     [--subscription]
                                     [--yes]

Examples

Detach vnet for a flexible server with public access disabled.

az mysql flexible-server detach-vnet --resource-group testGroup --name testserver --public-network-access Disabled

Required Parameters

--public-network-access

Determines the public access after vnet detach.

Property Value
Accepted values: Disabled, Enabled

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

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.

Property Value
Parameter group: Authentication Arguments
--admin-user -u

The login username of the administrator.

Property Value
Parameter group: Authentication 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.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server geo-restore

Geo-restore a flexible server from backup.

az mysql flexible-server geo-restore --___location
                                     --source-server
                                     [--accelerated-logs {Disabled, Enabled}]
                                     [--address-prefixes]
                                     [--backup-retention]
                                     [--geo-redundant-backup {Disabled, Enabled}]
                                     [--ids]
                                     [--name]
                                     [--no-wait]
                                     [--private-dns-zone]
                                     [--public-access {Disabled, Enabled}]
                                     [--resource-group]
                                     [--sku-name]
                                     [--storage-auto-grow {Disabled, Enabled}]
                                     [--storage-redundancy {LocalRedundancy, ZoneRedundancy}]
                                     [--storage-size]
                                     [--subnet]
                                     [--subnet-prefixes]
                                     [--subscription]
                                     [--tags]
                                     [--tier]
                                     [--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-restore 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

Geo-restore 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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-logs

Enable or disable accelerated logs. Only support for Business Critical tier. Default value is Enabled.

Property Value
Accepted values: Disabled, Enabled
--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.

--backup-retention

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

--geo-redundant-backup

Whether or not geo redundant backup is enabled.

Property Value
Accepted values: Disabled, Enabled
--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--no-wait

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

Property Value
Default value: False
--private-dns-zone

This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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.

Property Value
Accepted values: Disabled, Enabled
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--sku-name

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

--storage-auto-grow

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

Property Value
Accepted values: Disabled, Enabled
--storage-redundancy

Enable local redundancy or zone redundancy. Zone redundancy only supports Business Critical tier.

Property Value
Accepted values: LocalRedundancy, ZoneRedundancy
--storage-size

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

--subnet

Name or resource ID of a new or existing subnet. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--tags

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

--tier

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

--vnet

Name or ID of a new or existing virtual network. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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.

Property Value
Default value: False
--zone -z

Availability zone into which to provision the resource.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--resource-group -g

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server restart

Restart a flexible server.

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

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server restore

Restore a flexible server from backup.

az mysql flexible-server restore --source-server
                                 [--accelerated-logs {Disabled, Enabled}]
                                 [--address-prefixes]
                                 [--backup-retention]
                                 [--database-port]
                                 [--faster-restore {Disabled, Enabled}]
                                 [--geo-redundant-backup {Disabled, Enabled}]
                                 [--ids]
                                 [--name]
                                 [--no-wait]
                                 [--private-dns-zone]
                                 [--public-access {Disabled, Enabled}]
                                 [--resource-group]
                                 [--restore-time]
                                 [--sku-name]
                                 [--storage-auto-grow {Disabled, Enabled}]
                                 [--storage-redundancy {LocalRedundancy, ZoneRedundancy}]
                                 [--storage-size]
                                 [--subnet]
                                 [--subnet-prefixes]
                                 [--subscription]
                                 [--tags]
                                 [--tier]
                                 [--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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-logs

Enable or disable accelerated logs. Only support for Business Critical tier. Default value is Enabled.

Property Value
Accepted values: Disabled, Enabled
--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.

--backup-retention

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

--database-port

The port of the database. Default value is 3306.

--faster-restore

Enable or disable Auto scale IOPS configuration for both the source and the newly restored server to enable faster restore.

Property Value
Accepted values: Disabled, Enabled
--geo-redundant-backup

Whether or not geo redundant backup is enabled.

Property Value
Accepted values: Disabled, Enabled
--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--no-wait

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

Property Value
Default value: False
--private-dns-zone

This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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.

Property Value
Accepted values: Disabled, Enabled
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--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.

Property Value
Default value: 2025-07-18T11:11:08+00:00
--sku-name

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

--storage-auto-grow

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

Property Value
Accepted values: Disabled, Enabled
--storage-redundancy

Enable local redundancy or zone redundancy. Zone redundancy only supports Business Critical tier.

Property Value
Accepted values: LocalRedundancy, ZoneRedundancy
--storage-size

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

--subnet

Name or resource ID of a new or existing subnet. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--tags

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

--tier

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

--vnet

Name or ID of a new or existing virtual network. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. 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.

Property Value
Default value: False
--zone -z

Availability zone into which to provision the resource.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server show

Get the details of a flexible server.

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

Examples

Get the details of a flexible server

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

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

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]
                                                [--subscription]

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: Authentication Arguments
Default value: {password}
--admin-user -u

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

Property Value
Parameter group: Authentication Arguments
Default value: {login}
--database-name -d

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

Property Value
Parameter group: Resource Id Arguments
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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
Default value: {server}
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server start

Start a flexible server.

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

Examples

Start a flexible server.

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

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--no-wait

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

Property Value
Default value: False
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server stop

Stop a flexible server.

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

Examples

Stop a flexible server.

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

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--no-wait

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

Property Value
Default value: False
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server update

Update a flexible server.

[!WARNING] > Enabling High-availability may result in a short downtime for the server based on your server configuration.

az mysql flexible-server update [--accelerated-logs {Disabled, Enabled}]
                                [--add]
                                [--admin-password]
                                [--auto-scale-iops {Disabled, Enabled}]
                                [--backup-identity]
                                [--backup-key]
                                [--backup-retention]
                                [--disable-data-encryption {false, true}]
                                [--force-string]
                                [--geo-redundant-backup {Disabled, Enabled}]
                                [--high-availability {Disabled, SameZone, ZoneRedundant}]
                                [--identity]
                                [--ids]
                                [--iops]
                                [--key]
                                [--maintenance-policy-patch-strategy --patch-strategy {Regular, VirtualCanary}]
                                [--maintenance-window]
                                [--name]
                                [--public-access {Disabled, Enabled}]
                                [--remove]
                                [--replication-role]
                                [--resource-group]
                                [--set]
                                [--sku-name]
                                [--standby-zone]
                                [--storage-auto-grow {Disabled, Enabled}]
                                [--storage-size]
                                [--subscription]
                                [--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"

Set or change key and identity for data encryption.

# get key identifier of the existing key
newKeyIdentifier=$(az keyvault key show --vault-name testVault --name testKey \
  --query key.kid -o tsv)


# update server with new key/identity
az mysql flexible-server update --resource-group testGroup --name testserver \
  --key $newKeyIdentifier --identity newIdentity

Set or change key, identity, backup key and backup identity for data encryption with geo redundant backup.

# get key identifier of the existing key and backup key
newKeyIdentifier=$(az keyvault key show --vault-name testVault --name testKey \
  --query key.kid -o tsv)

newBackupKeyIdentifier=$(az keyvault key show --vault-name testBackupVault \
  --name testBackupKey --query key.kid -o tsv)


# update server with new key/identity and backup key/identity
az mysql flexible-server update --resource-group testGroup --name testserver \
  --key $newKeyIdentifier --identity newIdentity \
  --backup-key $newBackupKeyIdentifier --backup-identity newBackupIdentity

Disable data encryption for flexible server.

az mysql flexible-server update --resource-group testGroup --name testserver \
  --disable-data-encryption

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-logs

Enable or disable accelerated logs. Only support for Business Critical tier. Default value is Enabled.

Property Value
Accepted values: Disabled, Enabled
--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>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--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.

Property Value
Parameter group: Authentication Arguments
--auto-scale-iops

Enable or disable the auto scale iops. Default value is Enabled.

Property Value
Accepted values: Disabled, Enabled
--backup-identity

The name or resource ID of the geo backup user identity for data encryption. The identity needs to be in the same region as the backup region.

--backup-key

The resource ID of the geo backup keyvault key for data encryption. The key needs to be in the same region as the backup region.

--backup-retention

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

--disable-data-encryption

Disable data encryption by removing key(s).

Property Value
Default value: False
Accepted values: false, true
--force-string

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

Property Value
Parameter group: Generic Update Arguments
Default value: False
--geo-redundant-backup

Whether or not geo redundant backup is enabled.

Property Value
Accepted values: Disabled, Enabled
--high-availability

Enable (ZoneRedundant or SameZone) or disable high availability feature.

Property Value
Accepted values: Disabled, SameZone, ZoneRedundant
--identity

The name or resource ID of the user assigned identity for data encryption.

--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.

Property Value
Parameter group: 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.

--key

The resource ID of the primary keyvault key for data encryption.

--maintenance-policy-patch-strategy --patch-strategy

The patch strategy of maintenance policy. Accepted values: Regular, VirtualCanary. Default value is Regular.

Property Value
Accepted values: Regular, VirtualCanary
--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.

Property Value
Parameter group: Resource Id Arguments
--public-access

Enable or disable the public access on a server.

Property Value
Accepted values: Disabled, Enabled
--remove

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

Property Value
Parameter group: Generic Update Arguments
Default value: []
--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>.

Property Value
Parameter group: Resource Id Arguments
--set

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

Property Value
Parameter group: Generic Update Arguments
Default value: []
--sku-name

The name of the compute SKU. Follows the convention Standard_{VM name}. Examples: 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.

Property Value
Accepted values: Disabled, Enabled
--storage-size

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--tags

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

--tier

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az mysql flexible-server upgrade

Upgrade the major version of a flexible server.

az mysql flexible-server upgrade --version {8}
                                 [--ids]
                                 [--name]
                                 [--resource-group]
                                 [--subscription]
                                 [--yes]

Examples

Upgrade server 'testsvr' to MySQL major version 8.

# make sure that sql_mode only contains values allowed in new version, for example:
az mysql flexible-server parameter set -g testgroup -s testsvr -n sql_mode \
  -v "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"

# upgrade server to MySQL major version 8.
az mysql flexible-server upgrade -g testgroup -n testsvr -v 8

Required Parameters

--version -v

Server major version.

Property Value
Accepted values: 8

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

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]
                              [--subscription]
                              [--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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--created

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

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--custom

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

Property Value
Parameter group: Wait Condition Arguments
--deleted

Wait until deleted.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--exists

Wait until the resource exists.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--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.

Property Value
Parameter group: Resource Id Arguments
--interval

Polling interval in seconds.

Property Value
Parameter group: Wait Condition Arguments
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.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--timeout

Maximum wait in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False