Skip to content

Files

Latest commit

8852afb · Jan 29, 2021

History

History
51 lines (38 loc) · 1.79 KB

howto-connection-string-powershell.md

File metadata and controls

51 lines (38 loc) · 1.79 KB
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

How to generate an Azure Database for MariaDB connection string with PowerShell

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.

Requirements

This article uses the resources created in the following guide as a starting point:

Get the connection string

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

Next steps

[!div class="nextstepaction"] Customize Azure Database for MariaDB server parameters using PowerShell