Get-AzMySqlFlexibleServerConnectionString
Get the connection string according to client connection provider.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Get-AzMySqlFlexibleServerConnectionString
-Client <String>
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzMySqlFlexibleServerConnectionString
-Client <String>
-InputObject <IMySqlIdentity>
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Description
Get the connection string according to client connection provider.
Examples
Example 1: Get connection string by name
PS C:\> Get-AzMySqlFlexibleServerConnectionString -Client Python -ResourceGroupName PowershellMySqlTest -Name mysql-test
cnx = mysql.connector.connect(user=mysql_user, password="{your_password}", host="mysql-test.mysql.database.azure.com", port=3306, database="{your_database}", ssl_ca="{ca-cert filename}", ssl_disabled=False)
This cmdlet shows connection string of a client by server name.
Example 2: Get MySql server connection string by identity
PS C:\> Get-AzMySqlFlexibleServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Get-AzMySqlFlexibleServerConnectionString -Client PHP
$con=mysqli_init(); mysqli_real_connect($con, "mysql-test.mysql.database.azure.com", "mysql_test", {your_password}, {your_database}, 3306);
This cmdlet gets MySql server connection string by identity.
Parameters
Client connection provider.
| 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 for the connection string. 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.
| Type: | String |
| Aliases: | ServerName |
| 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 |
The subscription ID that identifies an Azure subscription.
| Type: | String |
| Position: | Named |
| Default value: | (Get-AzContext).Subscription.Id |
| 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 for the connection string.
[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.