使用 Azure CLI 重启 Azure Database for MySQL 服务器Restart Azure Database for MySQL server using the Azure CLI

本主题介绍如何重启 Azure Database for MySQL 服务器。This topic describes how you can restart an Azure Database for MySQL server. 出于维护原因,可能需要重启服务器,这会在服务器执行操作时导致短暂中断。You may need to restart your server for maintenance reasons, which causes a short outage as the server performs the operation.

如果服务处于繁忙状态,则会阻止重启服务器。The server restart will be blocked if the service is busy. 例如,服务可以处理缩放 vCores 等先前请求的操作。For example, the service may be processing a previously requested operation such as scaling vCores.

完成重启所需的时间取决于 MySQL 恢复过程。The time required to complete a restart depends on the MySQL recovery process. 若要减少重启时间,建议在重启之前尽量减少服务器上发生的活动量。To decrease the restart time, we recommend you minimize the amount of activity occurring on the server prior to the restart.

必备条件Prerequisites

若要完成本操作指南,需要:To complete this how-to guide, you need:

重要

本操作方法指南要求使用 Azure CLI 版本 2.0 或更高版本。This how-to guide requires that you use Azure CLI version 2.0 or later. 若要确认版本,请在 Azure CLI 命令提示符下输入 az --versionTo confirm the version, at the Azure CLI command prompt, enter az --version. 若要安装或升级,请参阅安装 Azure CLITo install or upgrade, see Install Azure CLI.

重启服务器Restart the server

使用以下命令重启服务器:Restart the server with the following command:

az mysql server restart --name mydemoserver --resource-group myresourcegroup

后续步骤Next steps

了解如何在 Azure Database for MySQL 中设置参数Learn about how to set parameters in Azure Database for MySQL