Test-AzMySqlFlexibleServerConnect
Test out the connection to the database server
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Test-AzMySqlFlexibleServerConnect
-Name <String>
-ResourceGroupName <String>
-AdministratorLoginPassword <SecureString>
[-DatabaseName <String>]
[-AdministratorUserName <String>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Test-AzMySqlFlexibleServerConnect
-Name <String>
-QueryText <String>
-ResourceGroupName <String>
-AdministratorLoginPassword <SecureString>
[-DatabaseName <String>]
[-AdministratorUserName <String>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Test-AzMySqlFlexibleServerConnect
-AdministratorLoginPassword <SecureString>
-InputObject <IMySqlIdentity>
[-DatabaseName <String>]
[-AdministratorUserName <String>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Test-AzMySqlFlexibleServerConnect
-QueryText <String>
-AdministratorLoginPassword <SecureString>
-InputObject <IMySqlIdentity>
[-DatabaseName <String>]
[-AdministratorUserName <String>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Description
Test out the connection to the database server
Examples
Example 1: Test connection by name
PS C:\> $password = ConvertTo-SecureString <YourPassword> -AsPlainText
PS C:\> Get-AzMySqlFlexibleServerConnect -ResourceGroupName PowershellMySqlTest -Name mysql-test -AdministratorLoginPassword $password
The connection testing to mysql-test.database.azure.com was successful!
Test connection by the resource group and the server name
Example 2: Test connection by identity
PS C:\> $password = ConvertTo-SecureString <YourPassword> -AsPlainText
PS C:\> Get-AzMySqlFlexibleServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Get-AzMySqlFlexibleServerConnect -AdministratorLoginPassword $password
The connection testing to mysql-test.database.azure.com was successful!
Test connection by the identity
Example 3: Test query by name
PS C:\> $password = ConvertTo-SecureString <YourPassword> -AsPlainText
PS C:\> Get-AzMySqlFlexibleServerConnect -ResourceGroupName PowershellMySqlTest -Name mysql-test -AdministratorLoginPassword $password -Query "SELECT * FROM test"
col
-----
1
2
3
Test a query by the resource group and the server name
Example 4: Test connection by identity
PS C:\> Get-AzMySqlFlexibleServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Get-AzMySqlFlexibleServerConnect -Query "SELECT * FROM test" -AdministratorLoginPassword $password
col
-----
1
2
3
Test a query by the identity
Parameters
The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.
| Type: | SecureString |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Administrator username for the server. Once set, it cannot be changed.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The database name to connect.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | PSObject |
| Aliases: | AzureRMContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The server to connect. To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
| Type: | IMySqlIdentity |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the server to connect.
| Type: | String |
| Aliases: | ServerName |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The query for the database to test
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Outputs
Notes
ALIASES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The server to connect.
[BackupName <String>]: The name of the backup.[ConfigurationName <String>]: The name of the server configuration.[DatabaseName <String>]: The name of the database.[FirewallRuleName <String>]: The name of the server firewall rule.[Id <String>]: Resource identity path[LocationName <String>]: The name of the location.[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.[SecurityAlertPolicyName <SecurityAlertPolicyName?>]: The name of the security alert policy.[ServerName <String>]: The name of the server.[SubscriptionId <String>]: The ID of the target subscription.[VirtualNetworkRuleName <String>]: The name of the virtual network rule.