We have already created the server now it’s time to connect to it. What you will need – connection string details, correct networking setup and a tool like MySQL Workbench.
Get MySQL workbench from https://www.mysql.com/products/workbench/ you will need an oracle account. Once downloaded, install it. From a networking perspective Azure DB for MySQL is similar to that of the SQL server variant, as you can see from the network settings below, click on connection security.
There are couple key areas to understand.
- Deny public access setting. Default is NO. select YES to allow private endpoints are to Azure Database for MySQL. When this setting is set to NO, clients can connect to your Azure Database for MySQL based on your firewall or VNet service endpoint settings shown below.
- Firewall setting is based on the IP address of connecting client.
Else leverage VNET service endpoints.
This will probably be the most likely method outside of private link, that is a specific Vnets can be mapped to the server, this depends on how you have designed the solution – personally when building solutions in Azure, if the technology supports private endpoints then thats what I go for.
4. – SSL and TLS settings SSL should be on and TLS minimum version stated (normally 1.2 is the best idea)
So, assuming you are happy with your network configuration you next need the connection string to enter into workbench, this being server name, admin user and password you entered at build stage.
You can find this on the overview section:
Load up workbench and create a connection:
Enter the relevant details – the hostname, username and password and test connection.
You could do this via Azure CLI too:
It will fail because of the SSL requirement, you either disable it which you should not do. So instead download the certificate and bind (https://docs.microsoft.com/en-us/azure/mysql/howto-configure-ssl) it thus the command would be:
mysql -h your.mysql.database.azure.com -u arunfake@mysqls -p –ssl-mode=REQUIRED –ssl-ca=c:\ssl\BaltimoreCyberTrustRoot.crt.pem
then you are in:
Then I issue basic SQL.