How to create a MySQL Database Server and Database in Azure Cloud

To Create A MySQL Database Server And Database In Azure Cloud

Introduction:

Azure SQL Database is a fully managed platform as a service (PaaS). Azure handles database management functions such as upgrading, patching, backups, and monitoring and we do not need to worry about these operations. Azure SQL Database provides 99.99% availability. We can create highly available and high-performance data storage using the SQL database service of Azure.

Pre-requisites

Azure Account (Create if you don’t have one).

Step 1: Login to Azure

Step 2: Create a MySQL Database in Azure Cloud.Click on "All services" in the left panel.

Step 3: You will see a screen with all the services, click on Databases - > SQS databases.

Step 4: This is the dashboard page. Now, click on "Add" to create your first SQL database.

Step 5: Here, for Resource Group click on create new, enter my-db-resource-group name, and then select OK, Add Database name as Linux help, and click on "create new" to create a new database server. Add Server Name, Server admin login name, password, and location. These details will be used to log in to the database server.

Step 6: Click on "Next: Networking" to proceed.Add the "Connectivity method" as "Public endpoint", keep the rest as is, and click on "Next: Additional settings".

Step 7: Click on "Next: Tags" to proceed with the default configuration here.

Step 8: Add a tag as "environment: test". You can add more tags of your choice. Click on "Next: Review + create" to proceed and create an SQL database.

Step 9: Verify the configurations we did and click on "Create".

Step 10: Once the database is ready, you will see a message as "Your deployment is complete". Click on "Go to resources" to check the database that has just been created.

Step 11: You can see that the database has been created. Click on Resource Group "my-db-resource-group" to check what all resources have been created upon creating the database.

Step 12: You can see that an SQL Server and SQL database has been created.Connect to the MySQL Database and Click on the SQL database to see the connection details to it.

Step 13: Once you open the SQL database, you will see a screen as follows.Click on "Query editor (preview)" to connect to the database.

Step 14: Enter your SQL Server credentials here.

Step 15: You will encounter an error as "Cannot open server 'XXXXXX' requested by the login. A client with the IP address 'XXX.XXX.XXX.XXX' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect."

Step 16: Now go back to "SQL database" - > "Query editor (preview)" and enter your login credentials.Upon successful login, you will see the Query Editor screen.

Step 17: You can now create tables in the database.

Step 18: To create a sample table, you can use the following query.

CREATE TABLE Persons ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) );
Click on "Run" to execute the query.

Step 19: Delete the Database.When you no longer need the Database, go back to the resource group and delete it to delete all the resources related to the SQL Server. Click on "Delete resource group", type in the Resource Group name, and click on "Delete".

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to create a MySQL Database Server and Database in Azure Cloud. Your feedback is much welcome.

FAQ
Q
What is the default MySQL password?
A
The default user for MySQL is root and by default, it has no password.
Q
What is the default port of MySQL?
A
Port 3306 is the default port for the classic MySQL protocol (port), which is used by the MySQL client, MySQL Connectors, and utilities such as mysqldump and mysqlpump.
Q
Which databases are free in Azure?
A
You can have only one free Azure SQL Server database per region, it reverts to Standard Edition after 365 days. Here's the list of Azure locations that do support the creation of a limited time (365 days) Free Azure SQL Server and Azure SQL Database.
Q
Is MySQL free in Azure?
A
Azure Database for MySQL - Flexible Server will be available for free with an Azure Free Account starting in June 2021. Microsoft is making it easier than ever to get started with your development of Azure Database for MySQL on Azure.
Q
What is Azure SQL Database for MySQL?
A
Azure Database for MySQL Single Server is a fully managed database service designed for minimal customization. The single server platform is designed to handle most of the database management functions such as patching, backups, high availability, and security with minimal user configuration and control.