az mysql flexible-server
Note
此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。
管理適用於 MySQL 的 Azure 資料庫彈性伺服器。
命令
az mysql flexible-server connect
線上到彈性伺服器。
az mysql flexible-server connect --admin-user
--name
[--admin-password]
[--database-name]
[--interactive]
[--querytext]
必要參數
系統管理員的登入用戶名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
系統管理員的登入密碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
資料庫的名稱。
傳遞此參數以在互動式模式中連線到資料庫。
自變數 'querytext' 已被取代,並將在未來版本中移除。 請改用 『execute』。
針對彈性伺服器執行的查詢。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az mysql flexible-server create
建立 MySQL 彈性伺服器。
使用自定義或預設組態建立 MySQL 彈性伺服器。 如需網路設定的詳細資訊,請參閱
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]
範例
使用自定義參數建立 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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
啟用或停用加速記錄。 僅支援業務關鍵層。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
以 CIDR 格式建立新虛擬網路時要使用的 IP 位址前置碼。 預設值為 10.0.0.0/16。
系統管理員的密碼。 最少8個字元,最多128個字元。 密碼必須包含下列三個類別的字元:英文大寫字母、英文小寫字母、數位和非英數位元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
伺服器的系統管理員用戶名稱。 設定之後,就無法變更。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
| 預設值: | panickygiraffe5 |
啟用或停用自動調整 iops。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 預設值: | Enabled |
| 接受的值: | Disabled, Enabled |
數據加密之異地備份使用者身分識別的名稱或資源識別碼。 身分識別必須位於與備份區域相同的區域中。
備份之間的間隔(以小時為單位)。 接受的值為 24、12 和 6。 預設值為 24。
用於數據加密之異地備份密鑰保存庫金鑰的資源識別碼。 金鑰必須位於與備份區域相同的區域中。
保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。
| 屬性 | 值 |
|---|---|
| 預設值: | 7 |
布建資料庫伺服器時要建立的資料庫名稱。
資料庫的埠。 預設值為3306。
是否啟用異地備援備份。
| 屬性 | 值 |
|---|---|
| 預設值: | Disabled |
| 接受的值: | Disabled, Enabled |
啟用 (ZoneRedundant 或 SameZone) 或停用高可用性功能。
| 屬性 | 值 |
|---|---|
| 預設值: | Disabled |
| 接受的值: | Disabled, SameZone, ZoneRedundant |
用於數據加密之使用者指派身分識別的名稱或資源識別碼。
要為此伺服器配置的 IOPS 數目。 您將根據布建的計算和記憶體,取得特定數量的免費 IOPS。 IOPS 的預設值為免費的 IOPS。 若要深入瞭解以計算和記憶體為基礎的 IOPS,請參閱適用於 MySQL 的 Azure 資料庫中的 IOPS 彈性伺服器。
數據加密之主要金鑰保存庫金鑰的資源識別碼。
Location. 來自的值: az account list-locations。 您可以使用 來設定預設位置 az configure --defaults location=<location>。
維護原則的修補策略。 接受的值:一般、VirtualCanary。 默認值為 [一般]。
| 屬性 | 值 |
|---|---|
| 接受的值: | Regular, VirtualCanary |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 新或現有私人 DNS 區域的名稱或標識碼。 您可以使用來自相同資源群組、不同資源群組或不同訂用帳戶的私人 DNS 區域。 如果您想要使用來自不同資源群組或訂用帳戶的區域,請提供資源識別碼。如果使用者未提供,CLI 會在與虛擬網路相同的資源群組內建立新的私人 DNS 區域。
判斷公用存取。 輸入要包含在允許IP清單中的單一或IP位址範圍。 IP 位址範圍必須以虛線分隔,且不包含任何空格。 指定 0.0.0.0 允許從 Azure 內部署的任何資源進行公用存取,以存取您的伺服器。 將它設定為 「None」 會以公用存取模式設定伺服器,但不會建立防火牆規則。
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。
| 屬性 | 值 |
|---|---|
| 預設值: | Standard_B1ms |
啟用高可用性時,待命伺服器的可用性區域資訊。
啟用或停用記憶體的自動成長。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 預設值: | Enabled |
| 接受的值: | Disabled, Enabled |
啟用本機備援或區域備援。 區域備援僅支援業務關鍵層。
| 屬性 | 值 |
|---|---|
| 預設值: | LocalRedundancy |
| 接受的值: | LocalRedundancy, ZoneRedundancy |
伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。
| 屬性 | 值 |
|---|---|
| 預設值: | 32 |
新或現有子網的名稱或資源標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的子網,請提供資源識別碼,而不是名稱。 請注意,子網將會委派給彈性伺服器。 委派之後,此子網無法用於任何其他類型的 Azure 資源。
以 CIDR 格式建立新子網時要使用的子網 IP 位址前綴。 預設值為 10.0.0.0/24。
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。
| 屬性 | 值 |
|---|---|
| 預設值: | Burstable |
伺服器主要版本。
| 屬性 | 值 |
|---|---|
| 預設值: | 8.0.21 |
新或現有虛擬網路的名稱或標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的 vnet,請提供資源識別碼。 名稱必須介於 2 到 64 個字元之間。 名稱的開頭必須是字母或數位、以字母、數位或底線結尾,而且只能包含字母、數位、底線、句號或連字元。
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
要在其中布建資源的可用性區域。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿提示確認。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az mysql flexible-server detach-vnet
中斷鏈接彈性伺服器的 vnet。
az mysql flexible-server detach-vnet --public-network-access {Disabled, Enabled}
[--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
範例
針對停用公用存取的彈性伺服器中斷連結 vnet。
az mysql flexible-server detach-vnet --resource-group testGroup --name testserver --public-network-access Disabled
必要參數
決定 vnet 中斷鏈接之後的公用存取。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az mysql flexible-server execute
線上到彈性伺服器。
az mysql flexible-server execute --admin-password
--admin-user
--name
[--database-name]
[--file-path]
[--querytext]
必要參數
系統管理員的登入密碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
系統管理員的登入用戶名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
資料庫的名稱。
要執行的 sql 檔案路徑。
針對彈性伺服器執行的查詢。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az mysql flexible-server geo-restore
從備份異地還原彈性伺服器。
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]
範例
將 「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. 來自的值: az account list-locations。 您可以使用 來設定預設位置 az configure --defaults location=<location>。
要從中還原的來源伺服器名稱或資源標識碼。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
啟用或停用加速記錄。 僅支援業務關鍵層。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
以 CIDR 格式建立新虛擬網路時要使用的 IP 位址前置碼。 預設值為 10.0.0.0/16。
保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。
是否啟用異地備援備份。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 新或現有私人 DNS 區域的名稱或標識碼。 您可以使用來自相同資源群組、不同資源群組或不同訂用帳戶的私人 DNS 區域。 如果您想要使用來自不同資源群組或訂用帳戶的區域,請提供資源識別碼。如果使用者未提供,CLI 會在與虛擬網路相同的資源群組內建立新的私人 DNS 區域。
判斷公用存取。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。
啟用或停用記憶體的自動成長。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
啟用本機備援或區域備援。 區域備援僅支援業務關鍵層。
| 屬性 | 值 |
|---|---|
| 接受的值: | LocalRedundancy, ZoneRedundancy |
伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。
新或現有子網的名稱或資源標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的子網,請提供資源識別碼,而不是名稱。 請注意,子網將會委派給彈性伺服器。 委派之後,此子網無法用於任何其他類型的 Azure 資源。
以 CIDR 格式建立新子網時要使用的子網 IP 位址前綴。 預設值為 10.0.0.0/24。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。
新或現有虛擬網路的名稱或標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的 vnet,請提供資源識別碼。 名稱必須介於 2 到 64 個字元之間。 名稱的開頭必須是字母或數位、以字母、數位或底線結尾,而且只能包含字母、數位、底線、句號或連字元。
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
要在其中布建資源的可用性區域。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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. 來自的值: az account list-locations。 您可以使用 來設定預設位置 az configure --defaults location=<location>。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
伺服器重新啟動作業的強制故障轉移。 允許的值:強制。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az mysql flexible-server restore
從備份還原彈性伺服器。
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]
範例
將 『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
必要參數
要從中還原的來源伺服器名稱或資源標識碼。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
啟用或停用加速記錄。 僅支援業務關鍵層。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
以 CIDR 格式建立新虛擬網路時要使用的 IP 位址前置碼。 預設值為 10.0.0.0/16。
保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。
資料庫的埠。 預設值為3306。
為源伺服器和新還原的伺服器啟用或禁用 Auto Scale IOPS 配置,以實現更快的還原。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
是否啟用異地備援備份。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 新或現有私人 DNS 區域的名稱或標識碼。 您可以使用來自相同資源群組、不同資源群組或不同訂用帳戶的私人 DNS 區域。 如果您想要使用來自不同資源群組或訂用帳戶的區域,請提供資源識別碼。如果使用者未提供,CLI 會在與虛擬網路相同的資源群組內建立新的私人 DNS 區域。
判斷公用存取。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
從UTC還原的時間點(ISO8601格式),例如2017-04-26T02:10:00+00:00預設值會設定為目前時間。
| 屬性 | 值 |
|---|---|
| 預設值: | 2025-12-05T11:14:56+00:00 |
計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。
啟用或停用記憶體的自動成長。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
啟用本機備援或區域備援。 區域備援僅支援業務關鍵層。
| 屬性 | 值 |
|---|---|
| 接受的值: | LocalRedundancy, ZoneRedundancy |
伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。
新或現有子網的名稱或資源標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的子網,請提供資源識別碼,而不是名稱。 請注意,子網將會委派給彈性伺服器。 委派之後,此子網無法用於任何其他類型的 Azure 資源。
以 CIDR 格式建立新子網時要使用的子網 IP 位址前綴。 預設值為 10.0.0.0/24。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。
新或現有虛擬網路的名稱或標識碼。 只有在您建立具有私人存取權的跨區域複本伺服器時,才適用此參數。 對於具有私用存取權的區域讀取複本,來源伺服器設定會進行,而且會忽略此參數。 如果您想要使用來自不同資源群組或訂用帳戶的 vnet,請提供資源識別碼。 名稱必須介於 2 到 64 個字元之間。 名稱的開頭必須是字母或數位、以字母、數位或底線結尾,而且只能包含字母、數位、底線、句號或連字元。
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
要在其中布建資源的可用性區域。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
系統管理員的密碼。 最少8個字元,最多128個字元。 密碼必須包含下列三個類別的字元:英文大寫字母、英文小寫字母、數位和非英數位元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
| 預設值: | {password} |
伺服器的系統管理員用戶名稱。 設定之後,就無法變更。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
| 預設值: | {login} |
布建資料庫伺服器時要建立的資料庫名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
| 預設值: | {database} |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
| 預設值: | {server} |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az mysql flexible-server update
更新彈性伺服器。
警告
根據您的伺服器配置,啟用高可用性可能會導致伺服器短暫停機。
az mysql flexible-server update [--accelerated-logs {Disabled, Enabled}]
[--add]
[--admin-password]
[--auto-scale-iops {Disabled, Enabled}]
[--backup-identity]
[--backup-interval]
[--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]
範例
使用伺服器和資源群組的本機內容來更新彈性伺服器的 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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
啟用或停用加速記錄。 僅支援業務關鍵層。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例: --add property.listProperty <key=value, string or JSON string>.
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
| 預設值: | [] |
系統管理員的密碼。 最少8個字元,最多128個字元。 密碼必須包含下列三個類別的字元:英文大寫字母、英文小寫字母、數位和非英數位元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Authentication Arguments |
啟用或停用自動調整 iops。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
數據加密之異地備份使用者身分識別的名稱或資源識別碼。 身分識別必須位於與備份區域相同的區域中。
備份之間的間隔(以小時為單位)。 接受的值為 24、12 和 6。 預設值為 24。
用於數據加密之異地備份密鑰保存庫金鑰的資源識別碼。 金鑰必須位於與備份區域相同的區域中。
保留備份的天數。 範圍 1 到 35 天。 預設值為 7 天。
拿掉金鑰來停用資料加密。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
| 接受的值: | false, true |
使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
| 預設值: | False |
是否啟用異地備援備份。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
啟用 (ZoneRedundant 或 SameZone) 或停用高可用性功能。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, SameZone, ZoneRedundant |
用於數據加密之使用者指派身分識別的名稱或資源識別碼。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
要為此伺服器配置的 IOPS 數目。 您將根據布建的計算和記憶體,取得特定數量的免費 IOPS。 IOPS 的預設值為免費的 IOPS。 若要深入瞭解以計算和記憶體為基礎的 IOPS,請參閱適用於 MySQL 的 Azure 資料庫中的 IOPS 彈性伺服器。
數據加密之主要金鑰保存庫金鑰的資源識別碼。
維護原則的修補策略。 接受的值:一般、VirtualCanary。 默認值為 [一般]。
| 屬性 | 值 |
|---|---|
| 接受的值: | Regular, VirtualCanary |
指定維護的期間(UTC)。 範例:「Sun:23:30」 以排程在星期日,下午 11:30 UTC。 若要將 設定為預設傳入 「Disabled」。
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
啟用或停用伺服器上的公用存取。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove> 或 --remove propertyToRemove。
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
| 預設值: | [] |
伺服器的復寫角色。
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>.
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
| 預設值: | [] |
計算 SKU 的名稱。 遵循Standard_{VM 名稱}的慣例。 範例:Standard_B1ms。
啟用高可用性時,待命伺服器的可用性區域資訊。
啟用或停用記憶體的自動成長。 預設值為 Enabled。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
伺服器的儲存容量。 最小值為 32 GiB,最大值為 16 TiB。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
伺服器的計算層。 接受的值:高載、GeneralPurpose、MemoryOptimized。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az mysql flexible-server upgrade
升級彈性伺服器的主要版本。
az mysql flexible-server upgrade --version {8, 8.4}
[--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
必要參數
伺服器主要版本。
| 屬性 | 值 |
|---|---|
| 接受的值: | 8, 8.4 |
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿提示確認。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
請等候在 'Succeeded' 使用 'provisioningState' 建立。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
等到刪除為止。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
等候資源存在。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
輪詢間隔以秒為單位。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | 30 |
伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
以秒為單位的等候上限。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | 3600 |
等到 provisioningState 更新為 'Succeeded'。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |