Connect to the Azure Database service
You can connect to the Azure Database for MariaDB from the primary virtual machine. Follow the steps below:
- Log in to the Microsoft Azure portal.
- Select the “Resource groups” menu item and then select the resource group containing the Azure Database for MariaDB instance.
- Select the Azure Database for MariaDB instance.
Obtain the hostname and username for the Azure Database for MariaDB instance from the “Overview” page, as shown below:
Log in to the server console via SSH.
Download the CA certificate from https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem, as described in the official documentation.
Use the mysql command-line tool to connect to the Azure Database for MariaDB, as shown below. Replace the HOSTNAME and USERNAME placeholders with the actual hostname and username for the Azure Database for MariaDB instance, and use the correct path for the downloaded certificate file:
$ mysql -u USERNAME -h HOSTNAME --ssl-ca=./BaltimoreCyberTrustRoot.crt.pem -p
You will be prompted to enter a password. This is the same password you configured when deploying the Multi-Tier Solution.
You can also connect to the Azure Database for MariaDB instance from your own local system, as long as it has the client side command-line tool installed. By default, the Azure Database for MariaDB instance will deny connections from other hosts. Therefore, in this case, you must additionally add your local host’s IP address to the whitelist of allowed hosts using the “Settings -> Connection security” page of your Azure Database for MariaDB instance, as shown below: