az mysql flexible-server

Manage Azure Database for MySQL Flexible Servers.

Commands

az mysql flexible-server create

Create a 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 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 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 create

Create a flexible server.

az mysql flexible-server create [--address-prefixes]
                                [--admin-password]
                                [--admin-user,]
                                [--assign-identity]
                                [--backup-retention]
                                [--high-availability]
                                [--location]
                                [--name]
                                [--public-access]
                                [--resource-group]
                                [--sku-name]
                                [--storage-size]
                                [--subnet]
                                [--subnet-prefixes]
                                [--subscription]
                                [--tags]
                                [--tier]
                                [--version]
                                [--vnet]
                                [--zone,]

Examples

Create a MySQL flexible server with specified SKU and storage, using defaults from local context.

az mysql flexible-server create --name testServer --admin-password password

Create a MySQL flexible server with parameters set.

az mysql flexible-server create --location northeurope --resource-group testGroup --name testServer --admin-user username \
    --admin-password password --sku-name Standard_B1ms --tier GeneralPurpose --public-access 0.0.0.0 \
    --storage-size 32 --tags "key=value" --version 5.7

Optional Parameters

--address-prefixes

The virtual network address prefix.

--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: remoteWidgeon7
--assign-identity

Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault. No need to enter extra argument.

--backup-retention

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

default value: 7
--high-availability

Enable or disable high availability feature. Default value is Disabled.

default value: Disabled
--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.

--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. Specifying no IP address 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, Standard_D4s_v3.

default value: Standard_B1ms
--storage-size

The storage capacity of the server. Minimum is 5 GiB and increases in 1 GiB increments. Max is 16 TiB.

default value: 10
--subnet

Name or ID of the subnet that allows access to an Azure Flexible Server.

--subnet-prefixes

The subnet address prefix.

--subscription

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

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

The virtual network name.

--zone, -z

Availability zone into which to provision the resource.

az mysql flexible-server delete

Delete a flexible server.

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

Examples

Delete a flexible server.

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

Delete a flexible server without prompt or confirmation.

az mysql flexible-server delete --resource-group testGroup --name testServer --force

Optional Parameters

--force

Delete the server without prompt.

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

--subscription

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

az mysql flexible-server list

List available flexible servers.

az mysql flexible-server list [--query-examples]
                              [--resource-group]
                              [--subscription]

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

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

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

--subscription

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

az mysql flexible-server list-skus

Lists available sku's in the given region.

az mysql flexible-server list-skus --location
                                   [--subscription]

Examples

Lists available sku's in the given region.

az mysql flexible-server list-skus -l eastus

Required Parameters

--location -l

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

Optional Parameters

--subscription

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

az mysql flexible-server restart

Restart a flexible server.

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

Examples

Restart a flexible server.

az mysql flexible-server restart --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>.

--subscription

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

az mysql flexible-server restore

Restore a flexible server from backup.

az mysql flexible-server restore --source-server
                                 --time
                                 [--ids]
                                 [--location]
                                 [--name]
                                 [--no-wait]
                                 [--resource-group]
                                 [--subscription]

Examples

Restore 'testServer' to a specific point-in-time as a new server 'testServerNew'.

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

Restore 'testServer2' to 'testServerNew', where 'testServerNew' is in a different resource group from 'testServer2'.

az mysql flexible-server restore --resource-group testGroup --name testServerNew \
    --source-server "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMySQL/servers/testServer2" \
    --time "2017-06-15T13:10:00Z"

Required Parameters

--source-server

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

--time

The point in time to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+08:00.

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.

--location -l

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

--name -n

The name of the new server that is created by the restore command.

--no-wait

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

--resource-group -g

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

--subscription

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

az mysql flexible-server show

Get the details of a flexible server.

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

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.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

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

--subscription

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

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]

Optional Parameters

--admin-password -p

The login password of the administrator.

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

The login username of the administrator.

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

The name of a database.

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.

default value: {server}
--subscription

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

az mysql flexible-server start

Start a flexible server.

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

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

--subscription

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

az mysql flexible-server stop

Stop a flexible server.

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

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

--subscription

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

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}]
                                [--ids]
                                [--maintenance-window]
                                [--name]
                                [--remove]
                                [--replication-role]
                                [--resource-group]
                                [--set]
                                [--sku-name]
                                [--ssl-enforcement {Disabled, Enabled}]
                                [--storage-auto-grow {Disabled, Enabled}]
                                [--storage-size]
                                [--subnet]
                                [--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_D4s_v3

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 7 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 or disable high availability feature. Default value is Disabled.

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.

--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_B1ms, Standard_D4s_v3.

--ssl-enforcement

Enable or disable ssl enforcement for connections to server. Default is Enabled.

accepted values: Disabled, 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 5 GiB and increases in 1 GiB increments. Max is 16 TiB.

--subnet

Name or ID of the subnet that allows access to an Azure Flexible Server MySQL Server.

--subscription

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

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

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

--subscription

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

--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.