Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This article provides step-by-step procedure to perform point-in-time recoveries in Azure Database for MySQL Flexible Server using backups.
If you don't have an Azure subscription, create an Azure free account before you begin. Currently, with an Azure free account, you can try Azure Database for MySQL - Flexible Server free for 12 months. For more information, see Use an Azure free account to try Azure Database for MySQL - Flexible Server for free.
Install or upgrade Azure CLI to the latest version. See Install Azure CLI.
Login to Azure account using az login command. Note the id property, which refers to Subscription ID for your Azure account.
az login
If you have multiple subscriptions, choose the appropriate subscription in which you want to create the server using the az account set
command.
`
az account set --subscription <subscription id>
Create an Azure Database for MySQL Flexible Server instance if you haven't already created one by using the az mysql flexible-server create
command.
az mysql flexible-server create --resource-group myresourcegroup --name myservername
You can run the following command to restore a server to an earliest existing backup.
Usage
az mysql flexible-server restore --restore-time
--source-server
[--ids]
[--location]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
Example:
Restore a server from this 2021-03-03T13:10:00Z
backup snapshot.
az mysql flexible-server restore \
--name mydemoserver-restored \
--resource-group myresourcegroup \
--restore-time "2021-03-03T13:10:00Z" \
--source-server mydemoserver
Time taken to restore will depend on the size of the data stored in the server.
You can run the following command to geo-restore a server to the most recent backup available.
Usage
az mysql flexible-server geo-restore --source-server
--location
[--name]
[--no-wait]
[--resource-group]
[--subscription]
Example: Geo-restore 'mydemoserver' in region East US to a new server 'mydemoserver-restored' in its geo-paired location West US with the same network setting.
az mysql flexible-server geo-restore \
--name mydemoserver-restored \
--resource-group myresourcegroup \
--location "West US" \
--source-server mydemoserver
After the restore is completed, you should perform the following tasks to get your users and applications back up and running:
Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register today