az mysql server replica

Manage read replicas.

Commands

az mysql server replica create Create a read replica for a server.
az mysql server replica list List all read replicas for a given server.
az mysql server replica stop Stop replication to a read replica and make it a read/write server.

az mysql server replica create

Create a read replica for a server.

az mysql server replica create --name
--resource-group
--source-server
[--location]
[--no-wait]
[--sku-name]
[--subscription]

Examples

Create a read replica 'testreplsvr' for 'testsvr'.

az mysql server replica create -n testreplsvr -g testgroup -s testsvr

Create a read replica 'testreplsvr' for 'testsvr2', where 'testreplsvr' is in a different resource group.

az mysql server replica create -n testreplsvr -g testgroup \
                            -s "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMySQL/servers/testsvr2"

Required Parameters

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

--source-server -s

The name or resource ID of the master server to the create replica for.

Optional Parameters

--location -l

Location. Values from: az account list-locations. If not provided, the create replica will be in the same location as the master server.

--no-wait

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

--sku-name

The name of the sku. Follows the convention {pricing tier}{compute generation}{vCores} in shorthand. Examples: B_Gen5_1, GP_Gen5_4, MO_Gen5_16.

--subscription

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

az mysql server replica list

List all read replicas for a given server.

az mysql server replica list [--ids]
[--resource-group]
[--server-name]
[--subscription]

Examples

List all read replicas for master server 'testsvr'.

az mysql server replica list -g testgroup -s testsvr

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--resource-group -g

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

--server-name -s

Name of the master server.

--subscription

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

az mysql server replica stop

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

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

Examples

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

az mysql server replica stop -g testgroup -n testreplsvr

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

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

--yes -y

Do not prompt for confirmation.