the primary tool for this is mysqldump. it is a command line utility that creates a logical backup of your database. you will use it to export your data from azure and then import it into your on prem mysql server.
you need to get mysqldump installed on a machine that can connect to both your azure mariadb server and your on prem mysql server. this could be your local laptop or a jump box in azure.
the command to dump your database from azure looks like this.
mysqldump --host=<your-azure-server-name>.mariadb.database.azure.com --user=<admin-user>@<server-name> --password --ssl-mode=REQUIRED --databases <database-name> > backup.sql
this will create a file called backup.sql with all your schema and data. the --ssl-mode=REQUIRED part is crucial because azure requires encrypted connections.
once you have the backup file, you can import it into your on prem mysql server using the mysql command.
mysql --host=<on-prem-server> --user=<user> --password <database-name> < backup.sql
our docs on using mysqldump with azure database for mariadb are here https://learn.microsoft.com/azure/mariadb/howto-migrate-dump-restore
for very large databases, mysqldump can be slow. in that case, you might want to look into mydumper and myloader. they are third party tools that can do parallel exports and imports, which is much faster for big datasets. this might help in other migration scenarios too.
test the restore process with a small, non critical database first. this helps you work out any kinks in the process before you do it for real. make sure the versions of mariadb and mysql are compatible to avoid syntax errors.
remember that any ongoing writes to your azure database during the dump will not be captured. so schedule this during a quiet period or use a read replica to get a consistent backup without affecting your production users.
Best regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer