Create Azure Database for MySQL Servers

suji guna
3 min readAug 14, 2020

Hey All! this is my fourth article on Distributed and cloud computing- sample environment in azure cloud platform series. If you have missed the previous article you can visit the below link.

Now let us get to know what is Azure Database for MySQL

Azure Database for MySQL

Azure Database for MySQL is a relational database service in the Microsoft cloud based on the MySQL Community Edition.

What does this Azure Database for MySQL provides:

  • Built-in high availability with no additional cost.
  • Predictable performance, using inclusive pay-as-you-go pricing.
  • Scale as required within seconds.
  • Secured to guard sensitive data at-rest and in-motion.
  • Automatic backups and point-in-time-restore for up to 35 days.
  • Enterprise-grade security and compliance.

Now lets create Azure Database for MySQL server with portal.

Search for Azure Database for MySQL servers and create a new by selecting “ +Add ”.

Fill in the new server details form with the following information:

  • Subscription: Select the Azure subscription that you want to use for your server. If you have multiple subscriptions, choose the subscription in which you get billed for the resource.
  • Resource group: A new or existing resource group name. I have used SENG_SE15013 here.
  • Server name: A unique name that identifies your Azure Database for MySQL server.
  • Data source: Select None to create a new server from scratch. (You can select Backup if you were creating a server from a geo-backup of an existing Azure Database for MySQL server).
  • Server admin username: username for your server administrator.
  • Password:A new password for the server admin account.
  • Location: Choose the location that is closest to your users or your other Azure applications.
  • If you need to configure additional settings, you can. Then Select Review + Create.

Now we have created one. Its time to create client IP to configure firewall.

Configure firewall

Azure Databases for MySQL are protected by a firewall. By default, all connections to the server and the databases inside the server are rejected. Before connecting to Azure Database for MySQL for the first time, configure the firewall to add the client machine’s public network IP address (or IP address range).

Go to Overview and select Connection Security in the navigation pane.

Add Client IP now.

And now Open your terminal from mySQL bin. Execute the below comment to connect to azure MySQL server.

mysql -h hostname -P port -u server username -p

After executing the command you will be asked for password. Provide your server password and execute. You will see your connection id below.

You can execute your SQL queries afterwards.!

You can view your Azure Database for MySQL server details such as server name, server admin login name from the overview.

** Make sure you provide the server name , server admin login name and password in the terminal.**

Great!!!

Lets Deploy our backend (spring-boot) application using azure web app service in our next article…

Click the below Link to follow,

Deploy our backend (spring-boot) application using azure web app service.!

Reference: https://docs.microsoft.com/en-us/azure/mysql/tutorial-design-database-using-portal

To refer the ARM templates, please follow the link.

ARM Templates

--

--

suji guna

B.Sc in Software Engineering. University of Kelaniya, SriLanka.