Quickstart guide to MySQL Database on Azure
This course will help you understand how to use the Azure Management Portal to quickly create, connect and configure databases with MySQL Database on Azure. After you finish, you will have a sample MySQL database server on Azure and will understand how to use the Azure portal to perform basic management tasks.
- Step 1: Sign in to the Azure portal and create a MySQL server
- Step 2: Configure the firewall
- Step 3: Set the scheduled backup time
- Step 4: Create the database
- Step 5: Connect to the database
- Step 6: Migrate data (optional)
- Subsequent steps
Step 1: Sign in to the Azure portal and create a MySQL server
- Log in to the Azure Management Portal and press New in the navigation menu on the left. Select Database > MySQL Databases on Azure, then press Create at the bottom of the page.
- Enter the server name, select the appropriate subscriptions, and select the resource groups. Create an administrator account, select the location of the server, select the appropriate MySQL version, and then configure the performance.
Your administrator account name is in the format server name%username. Please ensure that you enter the complete username when you connect to the database. If other services on Azure need to access the database, select Allow Azure Services to access the database. We recommend that you select Fix to Dashboard to make management more convenient. We strongly recommend that you put the Azure Services in the same region and select the location closest to you.
Step 2: Configure the firewall
Before you connect to MySQL Database on Azure from your client for the first time, you must configure the firewall. You must add the client’s public network IP address (or IP address range) to the whitelist. In the Management Portal, select your MySQL server, then press Connection security.
The Management Portal has an Add client IP function that makes it easy to quickly add the IP address of the current client. If you selected Allow Azure Services to access the server when you created the database, your other services on Azure (including VMs on Azure) are allowed to access your MySQL database by default, so you don’t need to manually add other IP addresses. You can also ban access for other Azure Services by selecting Deny in the Allow Azure Services to access the server section of this page.
Step 3: Set the scheduled backup time
MySQL Database on Azure provides daily backups at a set time. To set the scheduled time for daily backups, select your MySQL server and press Backup. Choose the daily backup time from the drop-down box.
Step 4: Create databases
You can create multiple databases within a MySQL server. There’s no limit to the number of databases that can be created, but multiple databases will share server resources. Select the MySQL server, click on Databases, then press New database to create the database.
Step 5: Connect to a database
Get the connection details by viewing the Overview for the server within the Management Portal, then connect to the MySQL Database on Azure database through the app.
MySQL Database on Azure supports SSL connections. If your app isn’t in the same Azure datacenter as the MySQL database, we recommend that you use SSL connections to increase security.
Step 6: Migrate data (optional)
To migrate a large database from another location to MySQL Database on Azure, follow this migration procedure:
- 1: Export the data from the existing database to a file (for example, by using the mysqldump tool).
- 2: Send the file exported from the database to your specific VM on Azure. Use any data transfer tool that you’re familiar with (such as FTP) or use the AzCopy tool. If you use the AzCopy tool, you need to send the file to a storage blob before you send it to the VM.
- Step 3: Import the data from your Azure VM into your MySQL Database on Azure. This action can reduce the chance of experiencing migration failures due to connection dropouts.
Once you have completed the steps above, you will have created a MySQL Database on Azure database and gained an understanding of how to use the portal. Next, you can try out other features, such as checking database usage, backups, and recovery, as well as version upgrades and downgrades.
If you encounter any problems during operation, you can look at the management portal guide, contact technical support, or post your issue on one of theMSDN forums.