title | description | author | ms.author | ms.service | ms.custom | ms.topic | ms.date |
---|---|---|---|---|---|---|---|
Generate a connection string with PowerShell - Azure Database for MariaDB |
This article provides an Azure PowerShell example to generate a connection string for connecting to Azure Database for MariaDB. |
savjani |
pariks |
mariadb |
mvc, devx-track-azurepowershell |
how-to |
8/5/2020 |
This article demonstrates how to generate a connection string for an Azure Database for MariaDB server. You can use a connection string to connect to an Azure Database for MariaDB from many different applications.
This article uses the resources created in the following guide as a starting point:
The Get-AzMariaDbConnectionString
cmdlet is used to generate a connection string for connecting
applications to Azure Database for MariaDB. The following example returns the connection string for a
PHP client from mydemoserver.
Get-AzMariaDbConnectionString -Client PHP -Name mydemoserver -ResourceGroupName myresourcegroup
$con=mysqli_init();mysqli_ssl_set($con, NULL, NULL, {ca-cert filename}, NULL, NULL); mysqli_real_connect($con, "mydemoserver.mariadb.database.azure.com", "myadmin@mydemoserver", {your_password}, {your_database}, 3306);
Valid values for the Client
parameter include:
- ADO.NET
- JDBC
- Node.js
- PHP
- Python
- Ruby
- WebApp
[!div class="nextstepaction"] Customize Azure Database for MariaDB server parameters using PowerShell