你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az mysql server

管理 MySQL 服务器。

命令

名称 说明 类型 状态
az mysql server ad-admin

管理 MySQL 服务器的 Active Directory 管理员。

核心 GA
az mysql server ad-admin create

为 MySQL 服务器创建 Active Directory 管理员。

核心 GA
az mysql server ad-admin delete

删除 MySQL 服务器的 Active Directory 管理员istrator。

核心 GA
az mysql server ad-admin list

列出 MySQL 服务器的所有 Active Directory 管理员istrators。

核心 GA
az mysql server ad-admin show

获取 MySQL 服务器的 Active Directory 管理员istrator 信息。

核心 GA
az mysql server ad-admin wait

将 CLI 置于等待状态,直到满足 MySQL 服务器 Active Directory 管理员istrator 的条件。

核心 GA
az mysql server configuration

管理服务器的配置值。

核心 GA
az mysql server configuration list

列出服务器的配置值。

核心 GA
az mysql server configuration set

更新服务器的配置。

核心 GA
az mysql server configuration show

获取服务器的配置。”

核心 GA
az mysql server create

创建服务器。

核心 GA
az mysql server delete

删除服务器。

核心 GA
az mysql server firewall-rule

管理服务器的防火墙规则。

核心 GA
az mysql server firewall-rule create

为服务器创建新的防火墙规则。

核心 GA
az mysql server firewall-rule delete

删除防火墙规则。

核心 GA
az mysql server firewall-rule list

列出服务器的所有防火墙规则。

核心 GA
az mysql server firewall-rule show

获取防火墙规则的详细信息。

核心 GA
az mysql server firewall-rule update

更新防火墙规则。

核心 GA
az mysql server georestore

从备份异地还原服务器。

核心 GA
az mysql server key

管理 MySQL 服务器密钥。

核心 GA
az mysql server key create

创建服务器密钥。

核心 GA
az mysql server key delete

删除服务器密钥。

核心 GA
az mysql server key list

获取服务器密钥的列表。

核心 GA
az mysql server key show

显示服务器密钥。

核心 GA
az mysql server list

列出可用的服务器。

核心 GA
az mysql server list-skus

列出给定区域中的可用 SKU。

核心 GA
az mysql server private-endpoint-connection

管理 MySQL 服务器专用终结点连接。

核心 GA
az mysql server private-endpoint-connection approve

批准与 MySQL 服务器关联的指定专用终结点连接。

核心 GA
az mysql server private-endpoint-connection delete

删除与 MySQL 服务器关联的指定专用终结点连接。

核心 GA
az mysql server private-endpoint-connection reject

拒绝与 MySQL 服务器关联的指定专用终结点连接。

核心 GA
az mysql server private-endpoint-connection show

显示与 MySQL 服务器关联的专用终结点连接的详细信息。

核心 GA
az mysql server private-link-resource

管理 MySQL 服务器专用链接资源。

核心 GA
az mysql server private-link-resource list

列出 MySQL 服务器支持的专用链接资源。

核心 GA
az mysql server replica

管理读取副本 (replica)。

核心 GA
az mysql server replica create

创建服务器的只读副本。

核心 GA
az mysql server replica list

列出某个给定服务器的所有只读副本。

核心 GA
az mysql server replica stop

停止复制到只读副本,并使该副本成为读/写服务器。

核心 GA
az mysql server restart

重启服务器。

核心 GA
az mysql server restore

从备份还原服务器。

核心 GA
az mysql server show

获取服务器的详细信息。

核心 GA
az mysql server show-connection-string

显示 MySQL 服务器数据库的连接字符串。

核心 GA
az mysql server start

启动已停止的服务器。

核心 GA
az mysql server stop

停止正在运行的服务器。

核心 GA
az mysql server update

更新服务器。

核心 GA
az mysql server upgrade

将 mysql 服务器升级到更高版本,例如 5.6 到 5.7。

核心 GA
az mysql server vnet-rule

管理服务器的虚拟网络规则。

核心 GA
az mysql server vnet-rule create

创建虚拟网络规则以允许访问 MySQL 服务器。

核心 GA
az mysql server vnet-rule delete

删除具有给定名称的虚拟网络规则。

核心 GA
az mysql server vnet-rule list

获取服务器中的虚拟网络规则列表。

核心 GA
az mysql server vnet-rule show

获取虚拟网络规则。

核心 GA
az mysql server vnet-rule update

更新虚拟网络规则。

核心 GA
az mysql server wait

等待服务器满足某些条件。

核心 GA

az mysql server create

创建服务器。

az mysql server create [--admin-password]
                       [--admin-user]
                       [--assign-identity]
                       [--auto-grow {Disabled, Enabled}]
                       [--backup-retention]
                       [--geo-redundant-backup {Disabled, Enabled}]
                       [--infrastructure-encryption {Disabled, Enabled}]
                       [--location]
                       [--minimal-tls-version {TLS1_0, TLS1_1, TLS1_2, TLSEnforcementDisabled}]
                       [--name]
                       [--public]
                       [--resource-group]
                       [--sku-name]
                       [--ssl-enforcement {Disabled, Enabled}]
                       [--storage-size]
                       [--tags]
                       [--version]

示例

使用 sku GP_Gen5_2(常规用途、第 5 代硬件、2 个 vCore)在北欧创建 MySQL 服务器。

az mysql server create -l northeurope -g testgroup -n testsvr -u username -p password \
    --sku-name GP_Gen5_2

创建设置了所有参数的 MySQL 服务器。

az mysql server create -l northeurope -g testgroup -n testsvr -u username -p password \
    --sku-name B_Gen5_1 --ssl-enforcement Enabled --minimal-tls-version TLS1_0 --public-network-access Disabled \
    --backup-retention 10 --geo-redundant-backup Enabled --storage-size 51200 \
    --tags "key=value" --version 5.7

可选参数

--admin-password -p

管理员的密码。 最少 8 个字符,最多 128 个字符。 密码必须包含以下类别中的三个类别的字符:英文大写字母、英文小写字母、数字和非字母数字字符。

--admin-user -u

服务器管理员istrator 用户名。 设置后,无法更改它。

默认值: elasticturtle3
--assign-identity

为此服务器生成并分配 Azure Active Directory 标识,以用于 Azure KeyVault 等密钥管理服务。

默认值: False
--auto-grow

启用或禁用存储的自动增长。 默认值为“已启用”。

接受的值: Disabled, Enabled
默认值: Enabled
--backup-retention

备份保留的天数。 范围为 7 到 35 天。 默认值为 7 天。

--geo-redundant-backup

启用或禁用异地冗余备份。 默认值为 Disabled。 基本定价层不支持。

接受的值: Disabled, Enabled
--infrastructure-encryption -i

使用新的加密算法为数据添加可选的第二层加密。 默认值为 Disabled。

接受的值: Disabled, Enabled
--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--minimal-tls-version

启用 SSL 时,为连接到服务器的最小 TLS 版本设置。 默认值为 TL标准版nforcementDisabled。

接受的值: TLS1_0, TLS1_1, TLS1_2, TLSEnforcementDisabled
--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--public --public-network-access

启用或禁用对服务器的公用网络访问。 禁用后,只有通过专用链接建立的连接才能访问此服务器。 允许的值为:Enabled、Disabled、all、0.0.0.0、、 。 默认值为“已启用”。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--sku-name

SKU 的名称。 请遵循简写约定 {pricing tier} {compute generation} {vCores}。 示例:B_Gen5_1、GP_Gen5_4、MO_Gen5_16。

默认值: GP_Gen5_2
--ssl-enforcement

启用或禁用与服务器的连接的 ssl 强制实施。 默认值为“已启用”。

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

服务器的存储容量(以 MB 为单位)。 最小值为 5120,以 1024 为增量递增。 默认值为 5120。

默认值: 5120
--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。

--version

服务器主版本。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server delete

删除服务器。

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

示例

删除服务器。

az mysql server delete -g testgroup -n testsvr

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--yes -y

不提示确认。

默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server georestore

从备份异地还原服务器。

az mysql server georestore --location
                           --source-server
                           [--backup-retention]
                           [--geo-redundant-backup]
                           [--ids]
                           [--name]
                           [--no-wait]
                           [--resource-group]
                           [--sku-name]
                           [--subscription]

示例

将“testsvr”异地还原到位于美国西部 2 的新服务器“testsvrnew”。

az mysql server georestore -g testgroup -n testsvrnew --source-server testsvr -l westus2

将“testsvr”异地还原到位于美国西部 2 的新服务器“testsvrnew”,其 sku GP_Gen5_2。

az mysql server georestore -g testgroup -n testsvrnew --source-server testsvr -l westus2 --sku-name GP_Gen5_2

将“testsvr2”异地还原到新的服务器“testsvrnew”中,其中“testsvrnew”位于不同于“testsvr2”的资源组中。

az mysql server georestore -g testgroup -n testsvrnew \
    -s "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMySQL/servers/testsvr2" \
    -l westus2

必需参数

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--source-server -s

要从其还原的源服务器的名称或 ID。

可选参数

--backup-retention

备份保留的天数。 范围为 7 到 35 天。 默认值为 7 天。

--geo-redundant-backup

启用或禁用异地冗余备份。 默认值为 Disabled。 基本定价层不支持。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--no-wait

不等待长时间运行的操作完成。

默认值: False
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--sku-name

SKU 的名称。 默认为源服务器的 SKU。 请遵循简写约定 {pricing tier} {compute generation} {vCores}。 示例:B_Gen5_1、GP_Gen5_4、MO_Gen5_16。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server list

列出可用的服务器。

az mysql server list [--resource-group]

示例

列出订阅中的所有 MySQL 服务器。

az mysql server list

列出资源组中的所有 MySQL 服务器。

az mysql server list -g testgroup

可选参数

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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server list-skus

列出给定区域中的可用 SKU。

az mysql server list-skus --location

示例

列出给定区域中的可用 SKU。

az mysql server list-skus -l eastus

必需参数

--location -l

位置的名称。 必需。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server restart

重启服务器。

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

示例

重启服务器。

az mysql server restart -g testgroup -n testsvr

重启服务器。 (自动生成)

az mysql server restart --name testsvr --resource-group testgroup --subscription MySubscription

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server restore

从备份还原服务器。

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

示例

将“testsvr”还原到作为新服务器“testsvrnew”的特定时间点。

az mysql server restore -g testgroup -n testsvrnew --source-server testsvr --restore-point-in-time "2017-06-15T13:10:00Z"

将“testsvr2”还原到“testsvrnew”,其中“testsvrnew”位于不同于“testsvr2”的资源组中。

az mysql server restore -g testgroup -n testsvrnew \
    -s "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMySQL/servers/testsvr2" \
    --restore-point-in-time "2017-06-15T13:10:00Z"

必需参数

--pitr-time --restore-point-in-time

从 UTC 还原的时间点(ISO8601格式),例如 2017-04-26T02:10:00+08:00。

--source-server -s

要从中还原的源服务器的名称或资源 ID。

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--no-wait

不等待长时间运行的操作完成。

默认值: False
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server show

获取服务器的详细信息。

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

示例

获取服务器的详细信息

az mysql server show --name MyServer --resource-group MyResourceGroup

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server show-connection-string

显示 MySQL 服务器数据库的连接字符串。

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

示例

显示 cmd 和编程语言的连接字符串。

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

可选参数

--admin-password -p

管理员的登录密码。

默认值: {password}
--admin-user -u

管理员的登录用户名。

默认值: {username}
--database-name -d

数据库的名称。

默认值: {database}
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--server-name -s

服务器的名称。

默认值: {server}
--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server start

启动已停止的服务器。

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

示例

启动已停止的服务器。 (自动生成)

az mysql server start --name testsvr --resource-group testgroup --subscription MySubscription

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server stop

停止正在运行的服务器。

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

示例

停止正在运行的服务器。 (自动生成)

az mysql server stop --name testsvr --resource-group testgroup --subscription MySubscription

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server update

更新服务器。

az mysql server update [--add]
                       [--admin-password]
                       [--assign-identity]
                       [--auto-grow {Disabled, Enabled}]
                       [--backup-retention]
                       [--force-string]
                       [--ids]
                       [--minimal-tls-version {TLS1_0, TLS1_1, TLS1_2, TLSEnforcementDisabled}]
                       [--name]
                       [--public]
                       [--remove]
                       [--resource-group]
                       [--set]
                       [--sku-name]
                       [--ssl-enforcement {Disabled, Enabled}]
                       [--storage-size]
                       [--subscription]
                       [--tags]

示例

更新服务器的 SKU。

az mysql server update -g testgroup -n testsvrnew --sku-name GP_Gen5_4

更新服务器的标记。

az mysql server update -g testgroup -n testsvrnew --tags "k1=v1" "k2=v2"

更新服务器。 (自动生成)

az mysql server update --name testsvrnew --resource-group testgroup --ssl-enforcement Enabled --minimal-tls-version TLS1_0

可选参数

--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>

默认值: []
--admin-password -p

管理员的密码。 最少 8 个字符,最多 128 个字符。 密码必须包含以下类别中的三个类别的字符:英文大写字母、英文小写字母、数字和非字母数字字符。

--assign-identity

为此服务器生成并分配 Azure Active Directory 标识,以用于 Azure KeyVault 等密钥管理服务。

默认值: False
--auto-grow

启用或禁用存储的自动增长。 默认值为“已启用”。

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

备份保留的天数。 范围为 7 到 35 天。 默认值为 7 天。

--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

默认值: False
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--minimal-tls-version

启用 SSL 时,为连接到服务器的最小 TLS 版本设置。 默认值为 TL标准版nforcementDisabled。

接受的值: TLS1_0, TLS1_1, TLS1_2, TLSEnforcementDisabled
--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--public --public-network-access

启用或禁用对服务器的公用网络访问。 禁用后,只有通过专用链接建立的连接才能访问此服务器。 允许的值为:Enabled、Disabled、all、0.0.0.0、、 。 默认值为“已启用”。

--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

默认值: []
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>

默认值: []
--sku-name

SKU 的名称。 请遵循简写约定 {pricing tier} {compute generation} {vCores}。 示例:B_Gen5_1、GP_Gen5_4、MO_Gen5_16。

--ssl-enforcement

启用或禁用与服务器的连接的 ssl 强制实施。 默认值为“已启用”。

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

服务器的存储容量(以 MB 为单位)。 最小值为 5120,以 1024 为增量递增。 默认值为 5120。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server upgrade

将 mysql 服务器升级到更高版本,例如 5.6 到 5.7。

az mysql server upgrade --target-server-version
                        [--ids]
                        [--name]
                        [--resource-group]
                        [--subscription]

示例

升级 mysql 服务器。

az mysql server upgrade --name testsvr --resource-group testgroup --subscription MySubscription --target-server-version 5.7

必需参数

--target-server-version -t

要将 mysql 服务器升级到的服务器版本,当前仅支持 5.7。

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az mysql server wait

等待服务器满足某些条件。

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

示例

等待服务器满足某些条件。 (自动生成)

az mysql server wait --exists --name MyServer --resource-group MyResourceGroup

可选参数

--custom

等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--exists

等待资源存在。

默认值: False
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--interval

轮询间隔(以秒为单位)。

默认值: 30
--name -n

服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--timeout

最大等待(以秒为单位)。

默认值: 3600
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。