通过source_server恢复Mysql服务器时出错

问题描述 投票:0回答:1

我希望您一切都好,社区我有一个问题,我正在尝试在新的 Azure 订阅上恢复 Azure Mysql 服务器。为此,我使用命令

"az mysql flexible-server restore"
。但是有一个名为“source_server”的字段给我带来了问题,因为它正在修改导致我生成此错误的路径。 错误:命令因意外错误而失败。这是回溯: 错误:提供的 source_server C:/Users/denilsonhs/AppData/Local/Programs/Git/subscriptions/76f790a3-75b7-445c-a345-c2c0547e74ce/resourceGroups/ReactivacionComfama/providers/Microsoft.DBforMySQL/flexibleServers/flex-mysql-dev- QA 无效。

初始 ID 为:source_server="/subscriptions/$subscriptionorigin/resourceGroups/$RG/providers/Microsoft.DBforMySQL/flexibleServers/$server"。

但是当我运行该文件时,它会像这样更改我的路径:C:/Users/denilsonsonsonhs/AppData/Local/Programs/Git/subscriptions/76f790a3-75b7-445c-a345-c2c0547e74ce/resourceGroups/ReactivationComfama/providers/Microsoft .DBforMySQL/flexibleServers/flex-mysql-dev-qa。

你知道我该怎么做才能不改变路径并且可以毫无问题地执行文件。 为此,我使用 GitBash 和 azure-Cli。 我仍然关注您的回答,感谢社区!

我尝试直接输入 ID,但是当我运行恢复时,它会更改地址并且无法识别服务器在哪里。

附件是我启动代码后出现的附加代码示例。

azure azure-cli
1个回答
0
投票

您面临的问题主要是

source-server
参数。您需要将
resourceID
resourcename
作为参数传递给源服务器,而不是本地文件路径。

az mysql flexible-server restore --resource-group Databases-Resources --name xxx --source-server "/subscriptions/xxx/resourceGroups/<resource group>/providers/Microsoft.DBforMySQL/flexibleServers/<server>" --public-access Enabled

输出:

enter image description here

请参阅

az mysql flexible-server restore
命令参数以更好地理解。

© www.soinside.com 2019 - 2024. All rights reserved.