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

Get-AzMySqlServer

获取有关服务器的信息。

语法

List1 (默认值)

Get-AzMySqlServer
    [-SubscriptionId <String[]>]
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

Get

Get-AzMySqlServer
    -Name <String>
    -ResourceGroupName <String>
    [-SubscriptionId <String[]>]
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

List

Get-AzMySqlServer
    -ResourceGroupName <String>
    [-SubscriptionId <String[]>]
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

GetViaIdentity

Get-AzMySqlServer
    -InputObject <IMySqlIdentity>
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

说明

获取有关服务器的信息。

示例

示例 1:使用默认上下文获取 MySql 服务器

Get-AzMySqlServer
Name          Location AdministratorLogin Version StorageProfileStorageMb SkuName   SkuTier        SslEnforcement
----          -------- ------------------ ------- ----------------------- -------   -------        --------------
mysql-test-11 eastus   mysql_test         5.7     5120                    GP_Gen5_4 GeneralPurpose Enabled

此 cmdlet 获取具有默认上下文的 MySql 服务器。

示例 2:按资源组和服务器名称获取 MySql 服务器

Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -Name mysql-test
Name          Location AdministratorLogin Version StorageProfileStorageMb SkuName   SkuTier        SslEnforcement
----          -------- ------------------ ------- ----------------------- -------   -------        --------------
mysql-test    eastus   mysql_test         5.7     5120                    GP_Gen5_4 GeneralPurpose Enabled

此 cmdlet 按资源组和服务器名称获取 MySql 服务器。

示例 3:列出指定资源组中的所有 MySql 服务器

Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest
Name          Location AdministratorLogin Version StorageProfileStorageMb SkuName   SkuTier        SslEnforcement
----          -------- ------------------ ------- ----------------------- -------   -------        ------------
mysql-test    eastus   mysql_test         5.7     5120                    GP_Gen5_4 GeneralPurpose Enabled

此 cmdlet 列出指定资源组中的所有 MySql 服务器。

示例 4:按标识获取 MySql 服务器

$ID = "/subscriptions/<SubscriptionId>/resourceGroups/PowershellMySqlTest/providers/Microsoft.DBforMySQL/servers/mysql-test"
Get-AzMySqlServer -InputObject $ID
Name          Location AdministratorLogin Version StorageProfileStorageMb SkuName   SkuTier        SslEnforcement
----          -------- ------------------ ------- ----------------------- -------   -------        ------------
mysql-test    eastus   mysql_test         5.7     5120                    GP_Gen5_4 GeneralPurpose Enabled

此 cmdlet 列表按标识获取 MySql 服务器。

参数

-DefaultProfile

DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。

参数属性

类型:PSObject
默认值:None
支持通配符:False
不显示:False
别名:AzureRMContext, AzureCredential

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InputObject

要构造的标识参数,请参阅 INPUTOBJECT 属性的 NOTES 部分并创建哈希表。

参数属性

类型:IMySqlIdentity
默认值:None
支持通配符:False
不显示:False

参数集

GetViaIdentity
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Name

服务器的名称。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:服务器名称

参数集

Get
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ResourceGroupName

资源组的名称。 此名称不区分大小写。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Get
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
List
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SubscriptionId

目标订阅的 ID。

参数属性

类型:

String[]

默认值:(Get-AzContext).Subscription.Id
支持通配符:False
不显示:False

参数集

List1
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Get
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
List
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

IMySqlIdentity

输出

IServer