Share via


az mysql flexible-server

注意

此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。

管理 適用於 MySQL 的 Azure 資料庫 彈性伺服器。

命令

名稱 Description 類型 狀態
az mysql flexible-server ad-admin

管理伺服器 Active Directory 系統管理員。

核心 GA
az mysql flexible-server ad-admin create

建立 Active Directory 系統管理員。

核心 GA
az mysql flexible-server ad-admin delete

刪除 Active Directory 系統管理員。

核心 GA
az mysql flexible-server ad-admin list

列出所有 Active Directory 系統管理員。

核心 GA
az mysql flexible-server ad-admin show

取得 Active Directory 系統管理員。

核心 GA
az mysql flexible-server ad-admin wait

等候 Active Directory 系統管理員滿足特定條件。

核心 GA
az mysql flexible-server advanced-threat-protection-setting

管理伺服器的進階威脅防護設定。

核心 GA
az mysql flexible-server advanced-threat-protection-setting show

取得伺服器的進階威脅防護設定。

核心 GA
az mysql flexible-server advanced-threat-protection-setting update

更新伺服器的進階威脅防護設定。

核心 GA
az mysql flexible-server backup

管理彈性伺服器備份。

核心 GA
az mysql flexible-server backup create

為具有指定備份名稱的指定伺服器建立備份。

核心 GA
az mysql flexible-server backup list

列出指定伺服器的所有備份。

核心 GA
az mysql flexible-server backup show

顯示指定伺服器之特定備份的詳細數據。

核心 GA
az mysql flexible-server connect

連線 彈性伺服器。

副檔名 GA
az mysql flexible-server create

建立 MySQL 彈性伺服器。

核心 GA
az mysql flexible-server db

在彈性伺服器上管理 MySQL 資料庫。

核心 GA
az mysql flexible-server db create

在彈性伺服器上建立 MySQL 資料庫。

核心 GA
az mysql flexible-server db delete

刪除彈性伺服器上的資料庫。

核心 GA
az mysql flexible-server db list

列出彈性伺服器的資料庫。

核心 GA
az mysql flexible-server db show

顯示資料庫的詳細數據。

核心 GA
az mysql flexible-server delete

刪除彈性伺服器。

核心 GA
az mysql flexible-server deploy

啟用並執行 MySQL 伺服器的 GitHub Actions 工作流程。

核心 GA
az mysql flexible-server deploy run

在 github 存放庫中執行現有的工作流程。

核心 GA
az mysql flexible-server deploy setup

建立 MySQL 伺服器的 GitHub Actions 工作流程檔案。

核心 GA
az mysql flexible-server execute

連線 彈性伺服器。

副檔名 GA
az mysql flexible-server export

管理伺服器上的匯出備份。

核心 預覽​​
az mysql flexible-server export create

為具有指定備份名稱的指定伺服器建立匯出備份。

核心 預覽​​
az mysql flexible-server firewall-rule

管理伺服器的防火牆規則。

核心 GA
az mysql flexible-server firewall-rule create

為彈性伺服器建立新的防火牆規則。

核心 GA
az mysql flexible-server firewall-rule delete

刪除防火牆規則。

核心 GA
az mysql flexible-server firewall-rule list

列出彈性伺服器的所有防火牆規則。

核心 GA
az mysql flexible-server firewall-rule show

取得防火牆規則的詳細數據。

核心 GA
az mysql flexible-server firewall-rule update

更新防火牆規則。

核心 GA
az mysql flexible-server geo-restore

從備份異地還原彈性伺服器。

核心 GA
az mysql flexible-server gtid

管理伺服器上的 GTID。

核心 GA
az mysql flexible-server gtid reset

重設伺服器上的 GTID。

核心 GA
az mysql flexible-server identity

管理伺服器使用者指派的身分識別。

核心 GA
az mysql flexible-server identity assign

將使用者已簽署的受控識別新增至伺服器。

核心 GA
az mysql flexible-server identity list

列出來自伺服器的所有使用者指派受控識別。

核心 GA
az mysql flexible-server identity remove

從伺服器移除使用者已簽署的受控識別。

核心 GA
az mysql flexible-server identity show

從伺服器取得使用者指派的受控識別。

核心 GA
az mysql flexible-server import

管理 MySQL 彈性伺服器的匯入工作流程。

核心 GA
az mysql flexible-server import create

為彈性伺服器建立新的匯入工作流程。

核心 GA
az mysql flexible-server list

列出可用的彈性伺服器。

核心 GA
az mysql flexible-server list-skus

列出指定區域中可用的 SKU。

核心 GA
az mysql flexible-server parameter

管理彈性伺服器之伺服器參數值的命令。

核心 GA
az mysql flexible-server parameter list

列出彈性伺服器的參數值。

核心 GA
az mysql flexible-server parameter set

更新彈性伺服器的參數。

核心 GA
az mysql flexible-server parameter set-batch

彈性伺服器的批次更新參數。

核心 GA
az mysql flexible-server parameter show

取得彈性伺服器的參數。」。

核心 GA
az mysql flexible-server replica

管理讀取複本。

核心 GA
az mysql flexible-server replica create

建立伺服器的讀取複本。

核心 GA
az mysql flexible-server replica list

列出指定伺服器的所有讀取複本。

核心 GA
az mysql flexible-server replica stop-replication

停止複寫至讀取複本,並將其設為讀取/寫入伺服器。

核心 GA
az mysql flexible-server restart

重新啟動彈性伺服器。

核心 GA
az mysql flexible-server restore

從備份還原彈性伺服器。

核心 GA
az mysql flexible-server server-logs

管理伺服器記錄。

核心 GA
az mysql flexible-server server-logs download

下載記錄檔。

核心 GA
az mysql flexible-server server-logs list

列出伺服器的記錄檔。

核心 GA
az mysql flexible-server show

取得彈性伺服器的詳細數據。

核心 GA
az mysql flexible-server show-connection-string

顯示 MySQL 彈性伺服器資料庫的 連接字串。

核心 GA
az mysql flexible-server start

啟動彈性伺服器。

核心 GA
az mysql flexible-server stop

停止彈性伺服器。

核心 GA
az mysql flexible-server update

更新彈性伺服器。

核心 GA
az mysql flexible-server upgrade

升級彈性伺服器的主要版本。

核心 GA
az mysql flexible-server wait

等候彈性伺服器滿足特定條件。

核心 GA

az mysql flexible-server connect

連線 彈性伺服器。

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

必要參數

--admin-user -u

系統管理員的登入用戶名稱。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

選擇性參數

--admin-password -p

系統管理員的登入密碼。

--database-name -d

資料庫的名稱。

--interactive

傳遞此參數以在互動式模式中連線到資料庫。

--querytext -q
已被取代

自變數 'querytext' 已被取代,並將在未來版本中移除。 請改用 『execute』。

針對彈性伺服器執行的查詢。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server create

建立 MySQL 彈性伺服器。

使用自定義或預設組態建立 MySQL 彈性伺服器。 如需網路設定的詳細資訊,請參閱

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

範例

使用自定義參數建立 MySQL 彈性伺服器

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

使用預設啟用的預設參數和公用存取,建立 MySQL 彈性伺服器。 CLI 將會建立資源群組、伺服器名稱、使用者名稱、密碼和預設資料庫

az mysql flexible-server create

建立具有公用存取權的 MySQL 彈性伺服器,並新增 IP 位址範圍以存取此伺服器。 --public-access 參數可以是 'All'、'None'、 <startIpAddress>或 <startIpAddress>-<endIpAddress>

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

建立具有私人存取權的 MySQL 彈性伺服器。 如果提供的虛擬網路和子網不存在,將會建立具有指定位址前綴的虛擬網路和子網。

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

使用新的子網資源標識碼和新的私人 DNS 區域資源識別碼,建立 MySQL 彈性伺服器。 您可以在不同的訂用帳戶或資源群組中建立子網和 DNS 區域。

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

使用相同資源群組中的現有網路資源建立 MySQL 彈性伺服器。 提供的子網不應部署任何其他資源,如果尚未委派,此子網將會委派給 Microsoft.DBforMySQL/flexibleServers。 如果尚未連結,私人 DNS 區域將會連結至虛擬網路。

# 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

使用不同的資源群組/訂用帳戶中的現有網路資源,建立 MySQL 彈性伺服器。

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

使用數據加密建立 MySQL 彈性伺服器。

# 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

建立具有異地備援備份和數據加密的 MySQL 彈性伺服器。

# 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

選擇性參數

--address-prefixes

以 CIDR 格式建立新虛擬網路時要使用的 IP 位址前置碼。 預設值為 10.0.0.0/16。

--admin-password -p

系統管理員的密碼。 最少8個字元,最多128個字元。 密碼必須包含下列其中三種字元:英文大寫字母、英文小寫字母、數字和非英數字元。

--admin-user -u

伺服器 管理員 istrator 用戶名稱。 設定之後,就無法變更。

預設值: maleavocet9
--auto-scale-iops

啟用或停用自動調整 iops。 預設值為 Disabled。

接受的值: Disabled, Enabled
預設值: Disabled
--backup-identity

數據加密之異地備份使用者身分識別的名稱或資源識別碼。 身分識別必須位於與備份區域相同的區域中。

--backup-key

用於數據加密之異地備份密鑰保存庫金鑰的資源識別碼。 金鑰必須位於與備份區域相同的區域中。

--backup-retention

保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。

預設值: 7
--database-name -d

布建資料庫伺服器時要建立的資料庫名稱。

--geo-redundant-backup

是否啟用異地備援備份。

接受的值: Disabled, Enabled
預設值: Disabled
--high-availability

啟用 (ZoneRedundant 或 SameZone) 或停用高可用性功能。

接受的值: Disabled, SameZone, ZoneRedundant
預設值: Disabled
--identity

用於數據加密之使用者指派身分識別的名稱或資源識別碼。

--iops

要為此伺服器配置的 IOPS 數目。 您將根據布建的計算和記憶體,取得特定數量的免費 IOPS。 IOPS 的預設值為免費的 IOPS。 若要深入瞭解以計算和記憶體為基礎的 IOPS,請參閱彈性伺服器中的 IOPS 適用於 MySQL 的 Azure 資料庫。

--key

數據加密之主要金鑰保存庫金鑰的資源識別碼。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--private-dns-zone

只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 新或現有私人 DNS 區域的名稱或標識碼。 您可以使用來自相同資源群組、不同資源群組或不同訂用帳戶的私人 DNS 區域。 如果您想要使用來自不同資源群組或訂用帳戶的區域,請提供資源識別碼。如果使用者未提供,CLI 會在與虛擬網路相同的資源群組內建立新的私人 DNS 區域。

--public-access

判斷公用存取。 輸入要包含在允許IP清單中的單一或IP位址範圍。 IP 位址範圍必須以虛線分隔,且不包含任何空格。 指定 0.0.0.0 允許從 Azure 內部署的任何資源進行公用存取,以存取您的伺服器。 將它設定為 「None」 會以公用存取模式設定伺服器,但不會建立防火牆規則。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--sku-name

計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。

預設值: Standard_B1ms
--standby-zone

啟用高可用性時,待命伺服器的可用性區域資訊。

--storage-auto-grow

啟用或停用記憶體的自動成長。 預設值為 Enabled。

接受的值: Disabled, Enabled
預設值: Enabled
--storage-size

伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。

預設值: 32
--subnet

新或現有子網的名稱或資源標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的子網,請提供資源識別碼,而不是名稱。 請注意,子網將會委派給彈性伺服器。 委派之後,此子網無法用於任何其他類型的 Azure 資源。

--subnet-prefixes

以 CIDR 格式建立新子網時要使用的子網 IP 位址前綴。 預設值為 10.0.0.0/24。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--tier

伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。

預設值: Burstable
--version

伺服器主要版本。

預設值: 5.7
--vnet

新或現有虛擬網路的名稱或標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的 vnet,請提供資源識別碼。 名稱必須介於 2 到 64 個字元之間。 名稱的開頭必須是字母或數位、以字母、數位或底線結尾,而且只能包含字母、數位、底線、句號或連字元。

--yes -y

不提示確認。

預設值: False
--zone -z

要在其中布建資源的可用性區域。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server delete

刪除彈性伺服器。

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

範例

刪除彈性伺服器。

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

刪除彈性伺服器,而不需確認提示。

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

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--yes -y

不提示確認。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server execute

連線 彈性伺服器。

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

必要參數

--admin-password -p

系統管理員的登入密碼。

--admin-user -u

系統管理員的登入用戶名稱。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

選擇性參數

--database-name -d

資料庫的名稱。

--file-path -f

要執行的 sql 檔案路徑。

--querytext -q

針對彈性伺服器執行的查詢。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server geo-restore

從備份異地還原彈性伺服器。

az mysql flexible-server geo-restore --location
                                     --source-server
                                     [--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-size]
                                     [--subnet]
                                     [--subnet-prefixes]
                                     [--subscription]
                                     [--tags]
                                     [--tier]
                                     [--vnet]
                                     [--yes]
                                     [--zone]

範例

將 「testerver」異地還原至位置 『newLocation』 中具有相同網路設定的新伺服器 『testerverNew』。 私人存取伺服器將會使用不同的私人 DNS 區域。

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

異地還原公用存取或私人存取伺服器 『testerver』 作為具有新子網的新伺服器 『testerverNew』。 將會布建已還原伺服器的新 vnet、子網和私人 DNS 區域。 如需更多私人存取案例,請參閱「彈性伺服器建立」命令。

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

異地還原私人存取伺服器 『testerver』 作為具有公用存取權的新伺服器 『testerverNew』。

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

必要參數

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--source-server

要從中還原的來源伺服器名稱或資源標識碼。

選擇性參數

--address-prefixes

以 CIDR 格式建立新虛擬網路時要使用的 IP 位址前置碼。 預設值為 10.0.0.0/16。

--backup-retention

保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。

--geo-redundant-backup

是否啟用異地備援備份。

接受的值: Disabled, Enabled
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--private-dns-zone

只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 新或現有私人 DNS 區域的名稱或標識碼。 您可以使用來自相同資源群組、不同資源群組或不同訂用帳戶的私人 DNS 區域。 如果您想要使用來自不同資源群組或訂用帳戶的區域,請提供資源識別碼。如果使用者未提供,CLI 會在與虛擬網路相同的資源群組內建立新的私人 DNS 區域。

--public-access

判斷公用存取。

接受的值: Disabled, Enabled
--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--sku-name

計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。

--storage-auto-grow

啟用或停用記憶體的自動成長。 預設值為 Enabled。

接受的值: Disabled, Enabled
--storage-size

伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。

--subnet

新或現有子網的名稱或資源標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的子網,請提供資源識別碼,而不是名稱。 請注意,子網將會委派給彈性伺服器。 委派之後,此子網無法用於任何其他類型的 Azure 資源。

--subnet-prefixes

以 CIDR 格式建立新子網時要使用的子網 IP 位址前綴。 預設值為 10.0.0.0/24。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--tier

伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。

--vnet

新或現有虛擬網路的名稱或標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的 vnet,請提供資源識別碼。 名稱必須介於 2 到 64 個字元之間。 名稱的開頭必須是字母或數位、以字母、數位或底線結尾,而且只能包含字母、數位、底線、句號或連字元。

--yes -y

不提示確認。

預設值: False
--zone -z

要在其中布建資源的可用性區域。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server list

列出可用的彈性伺服器。

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

範例

列出訂用帳戶中的所有 MySQL 彈性伺服器。

az mysql flexible-server list

列出資源群組中的所有 MySQL 彈性伺服器。

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

以數據表格式列出資源群組中的所有 MySQL 彈性伺服器。

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

選擇性參數

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server list-skus

列出指定區域中可用的 SKU。

az mysql flexible-server list-skus --location

範例

列出指定區域中可用的 SKU。

az mysql flexible-server list-skus -l eastus

列出數據表輸出中指定區域中可用的 SKU

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

必要參數

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server restart

重新啟動彈性伺服器。

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

範例

重新啟動彈性伺服器。

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

使用故障轉移重新啟動彈性伺服器

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

選擇性參數

--failover

伺服器重新啟動作業的強制故障轉移。 允許的值:強制。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server restore

從備份還原彈性伺服器。

az mysql flexible-server restore --source-server
                                 [--address-prefixes]
                                 [--backup-retention]
                                 [--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-size]
                                 [--subnet]
                                 [--subnet-prefixes]
                                 [--subscription]
                                 [--tags]
                                 [--tier]
                                 [--vnet]
                                 [--yes]
                                 [--zone]

範例

將 『testerver』 還原至具有相同網路設定的新伺服器 『testerverNew』 的特定時間點。

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

將公用存取或私人存取伺服器 『testerver』 還原為具有新子網的新伺服器 『testerverNew』 到目前的時間點。 將會布建已還原伺服器的新 vnet、子網和私人 DNS 區域。 如需更多私人存取案例,請參閱「彈性伺服器建立」命令。

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

以具有公用存取權的新伺服器 『testerverNew』 的形式,將私人存取伺服器 『testerver』 還原至目前的時間點。

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

必要參數

--source-server

要從中還原的來源伺服器名稱或資源標識碼。

選擇性參數

--address-prefixes

以 CIDR 格式建立新虛擬網路時要使用的 IP 位址前置碼。 預設值為 10.0.0.0/16。

--backup-retention

保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。

--geo-redundant-backup

是否啟用異地備援備份。

接受的值: Disabled, Enabled
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--private-dns-zone

只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 新或現有私人 DNS 區域的名稱或標識碼。 您可以使用來自相同資源群組、不同資源群組或不同訂用帳戶的私人 DNS 區域。 如果您想要使用來自不同資源群組或訂用帳戶的區域,請提供資源識別碼。如果使用者未提供,CLI 會在與虛擬網路相同的資源群組內建立新的私人 DNS 區域。

--public-access

判斷公用存取。

接受的值: Disabled, Enabled
--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--restore-time

從UTC還原的時間點(ISO8601格式),例如2017-04-26T02:10:00+00:00預設值會設定為目前時間。

預設值: 2024-05-21T03:19:24+00:00
--sku-name

計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。

--storage-auto-grow

啟用或停用記憶體的自動成長。 預設值為 Enabled。

接受的值: Disabled, Enabled
--storage-size

伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。

--subnet

新或現有子網的名稱或資源標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的子網,請提供資源識別碼,而不是名稱。 請注意,子網將會委派給彈性伺服器。 委派之後,此子網無法用於任何其他類型的 Azure 資源。

--subnet-prefixes

以 CIDR 格式建立新子網時要使用的子網 IP 位址前綴。 預設值為 10.0.0.0/24。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--tier

伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。

--vnet

新或現有虛擬網路的名稱或標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的 vnet,請提供資源識別碼。 名稱必須介於 2 到 64 個字元之間。 名稱的開頭必須是字母或數位、以字母、數位或底線結尾,而且只能包含字母、數位、底線、句號或連字元。

--yes -y

不提示確認。

預設值: False
--zone -z

要在其中布建資源的可用性區域。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server show

取得彈性伺服器的詳細數據。

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

範例

取得彈性伺服器的詳細數據

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

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server show-connection-string

顯示 MySQL 彈性伺服器資料庫的 連接字串。

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

範例

顯示 cmd 和程式設計語言的 連接字串。

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

選擇性參數

--admin-password -p

系統管理員的密碼。 最少8個字元,最多128個字元。 密碼必須包含下列其中三種字元:英文大寫字母、英文小寫字母、數字和非英數字元。

預設值: {password}
--admin-user -u

管理員 istrator 伺服器的用戶名稱。 設定之後,就無法變更。

預設值: {login}
--database-name -d

布建資料庫伺服器時要建立的資料庫名稱。

預設值: {database}
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--server-name -s

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

預設值: {server}
--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server start

啟動彈性伺服器。

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

範例

啟動彈性伺服器。

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

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server stop

停止彈性伺服器。

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

範例

停止彈性伺服器。

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

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server update

更新彈性伺服器。

az mysql flexible-server update [--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-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]

範例

使用伺服器和資源群組的本機內容來更新彈性伺服器的 SKU。

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

更新彈性伺服器的標記。

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

設定或變更數據加密的金鑰和身分識別。

# 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

使用異地備援備份來設定或變更數據加密的金鑰、身分識別、備份密鑰和備份身分識別。

# 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

停用彈性伺服器的數據加密。

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

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value, string or JSON string>

預設值: []
--admin-password -p

系統管理員的密碼。 最少8個字元,最多128個字元。 密碼必須包含下列其中三種字元:英文大寫字母、英文小寫字母、數字和非英數字元。

--auto-scale-iops

啟用或停用自動調整 iops。 預設值為 Disabled。

接受的值: Disabled, Enabled
--backup-identity

數據加密之異地備份使用者身分識別的名稱或資源識別碼。 身分識別必須位於與備份區域相同的區域中。

--backup-key

用於數據加密之異地備份密鑰保存庫金鑰的資源識別碼。 金鑰必須位於與備份區域相同的區域中。

--backup-retention

保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。

--disable-data-encryption

拿掉金鑰來停用資料加密。

接受的值: false, true
預設值: False
--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--geo-redundant-backup

是否啟用異地備援備份。

接受的值: Disabled, Enabled
--high-availability

啟用 (ZoneRedundant 或 SameZone) 或停用高可用性功能。

接受的值: Disabled, SameZone, ZoneRedundant
--identity

用於數據加密之使用者指派身分識別的名稱或資源識別碼。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--iops

要為此伺服器配置的 IOPS 數目。 您將根據布建的計算和記憶體,取得特定數量的免費 IOPS。 IOPS 的預設值為免費的 IOPS。 若要深入瞭解以計算和記憶體為基礎的 IOPS,請參閱彈性伺服器中的 IOPS 適用於 MySQL 的 Azure 資料庫。

--key

數據加密之主要金鑰保存庫金鑰的資源識別碼。

--maintenance-window

指定維護的期間(UTC)。 範例:「Sun:23:30」 以排程在星期日,下午 11:30 UTC。 若要將 設定為預設傳入 「Disabled」。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--public-access

啟用或停用伺服器上的公用存取。

接受的值: Disabled, Enabled
--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

預設值: []
--replication-role

伺服器的復寫角色。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=<value>

預設值: []
--sku-name

計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。

--standby-zone

啟用高可用性時,待命伺服器的可用性區域資訊。

--storage-auto-grow

啟用或停用記憶體的自動成長。 預設值為 Enabled。

接受的值: Disabled, Enabled
--storage-size

伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--tier

伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server upgrade

升級彈性伺服器的主要版本。

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

範例

將伺服器 『testvr』 升級至 MySQL 主要版本 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

必要參數

--version -v

伺服器主要版本。

接受的值: 8

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--yes -y

不提示確認。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az mysql flexible-server wait

等候彈性伺服器滿足特定條件。

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

範例

等候彈性伺服器滿足特定條件。

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

選擇性參數

--created

請等候在 'Succeeded' 使用 'provisioningState' 建立。

預設值: False
--custom

等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到刪除為止。

預設值: False
--exists

等候資源存在。

預設值: False
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--interval

輪詢間隔以秒為單位。

預設值: 30
--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--timeout

以秒為單位的等候上限。

預設值: 3600
--updated

等到 provisioningState 更新為 'Succeeded'。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。