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

az mysql

注意

此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 详细了解扩展。

管理 Azure Database for MySQL 服务器。

命令

名称 说明 类型 状态
az mysql db

管理服务器上的 MySQL 数据库。

核心 GA
az mysql db create

创建 MySQL 数据库。

核心 GA
az mysql db delete

删除数据库。

核心 GA
az mysql db list

列出服务器的数据库。

核心 GA
az mysql db show

显示数据库的详细信息。

核心 GA
az mysql down

删除 MySQL 服务器及其缓存的信息。

扩展 GA
az mysql flexible-server

管理 Azure Database for MySQL 灵活服务器。

核心和扩展 GA
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

管理服务器的高级威胁防护设置。

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

获取服务器的高级威胁防护设置。

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

更新服务器上的高级威胁防护设置。

核心 预览
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

管理读取副本 (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 server

管理 MySQL 服务器。

核心 GA
az mysql server-logs

管理服务器日志。

核心 GA
az mysql server-logs download

下载日志文件。

核心 GA
az mysql server-logs list

列出服务器的日志文件。

核心 GA
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 show-connection-string

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

扩展 GA
az mysql up

设置 Azure Database for MySQL 服务器和配置。

扩展 GA

az mysql down

删除 MySQL 服务器及其缓存的信息。

az mysql down [--delete-group]
              [--no-wait]
              [--resource-group]
              [--server-name]
              [--yes]

示例

从资源组中删除服务器和缓存的数据。

az mysql down

删除资源组和完整缓存。

az mysql down --delete-group

可选参数

--delete-group

删除该资源组。

--no-wait

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

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

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

--server-name -s

服务器的名称。

--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 show-connection-string

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

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

可选参数

--admin-password -p

管理员的登录密码。

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

管理员的登录用户名。

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

数据库的名称。

默认值: {database}
--server-name -s

服务器的名称。

默认值: {server}
全局参数
--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 up

设置 Azure Database for MySQL 服务器和配置。

az mysql up [--admin-password]
            [--admin-user]
            [--backup-retention]
            [--database-name]
            [--generate-password]
            [--geo-redundant-backup {Disabled, Enabled}]
            [--location]
            [--resource-group]
            [--server-name]
            [--sku-name]
            [--ssl-enforcement {Disabled, Enabled}]
            [--storage-size]
            [--tags]
            [--version]

示例

确保 Azure Database for MySQL 服务器已启动并运行并配置为立即使用。

az mysql up

若要替代默认名称,请提供指示所需值/现有资源的参数。

az mysql up -g MyResourceGroup -s MyServer -d MyDatabase -u MyUsername -p MyPassword

可选参数

--admin-password -p

管理员的登录密码。 最少 8 个字符,最多 128 个字符。 密码必须包含以下三个类别中的字符:英语大写字母、英文小写字母、数字和非字母数字字符。密码不能包含登录名的全部或部分。 登录名的一部分定义为三个或多个连续字母数字字符。

--admin-user -u

管理员的登录用户名。

--backup-retention

备份保留的天数。

--database-name -d

要初始化的数据库的名称。

--generate-password

生成密码。

--geo-redundant-backup

为服务器备份启用异地冗余或不启用。

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

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

--resource-group -g

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

--server-name -s

服务器的名称。

--sku-name

sku 的名称(通常为层 + 系列 + 核心),例如B_Gen4_1,GP_Gen5_8。

默认值: GP_Gen5_2
--ssl-enforcement

在连接到服务器时启用 ssl 强制。

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

服务器的最大存储大小。 单位为兆字节。

--tags

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

--version

服务器版本。

默认值: 5.7
全局参数
--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 获取完整的调试日志。