How to create Azure Database for MySQL Servers and configure it with terminal

Suthesana
3 min readAug 14, 2020

In this article i’m going to explain you how to create the Azure Database for MySQL Servers and configure it with terminal

MySQL in app was announced in March, 2017. Azure provides MySQL within your web app (App service), every web app in Azure has MySQL in app as an option.

Create an Azure Database for MySQL server using Azure portal

1.Go to the azure portal and search for MySQL and you will find Azure for MySQL servers and click on it and you will come up with a panel like the image shown below and then click add to create the server.

2.Next you will see a window like shown below and you have to fill the configuration fields like this

Subscription:Select the Azure subscription that you want to use for your server

Resource group: You can select an existing resource group or you create a new resource group

Server name: Enter a unique name. This name identifies your Azure Database for MySQL server.

Location:Choose the location that is closest to your users

Version:Select the version of MySQL to use for your server

Compute + Storage:The compute, storage, and backup configurations for your new server.Select Configure server and select the appropriate pricing tier.

Admin username:Enter a username for your server administrator.

Password : Password for the Admin username

3.Select Review + create

Now we have created our MySQL Server successfully. Next step is we Access MySQL server with command prompt/terminal.

Next go to the created MySQL server on azure portal and click on the connection security and click on add client ip and click save.

Ubuntu: Open a new terminal window and type the command like shown below and press enter. You will be asked for the password.Here you have type the server admin password that you have provided while creating SQL server in azure portal.Now we have connected to azure MySQL server. You can modify your Database Server like create database, create tables, query tables etc.

Command :

mysql -h serverName -P 3306 -u serverAdminName -p

In the above command replace the server and serverAdminName with your Host name and user name. You can find your host name and user name on the over view of your created MySQL server in azure portal.

Now create a database to store our data with spring boot backend.

Windows:Open command prompt and go to MySQL installation and follow the above steps.You will see a window like this.

Now let us move on to the next topic related to this article series:

How to deploy spring-boot application using azure web app service

--

--