Get Started with Azure Database for MariaDB
Learn how to provision, configure, and connect to a fully managed MariaDB server on Azure.
Overview
Azure Database for MariaDB is a fully managed relational database service based on MariaDB Community Edition. It handles automated backups, high availability, scaling, and security.
Prerequisites
- Azure subscription (free trial works)
- Azure CLI installed or Azure Portal access
- Basic knowledge of MariaDB and MySQL commands
1. Create a MariaDB Server
Use the Azure Portal or Azure CLI. Below is the CLI command:
az mariadb server create \
--resource-group MyResourceGroup \
--name mymariadbserver \
--location eastus \
--admin-user myadmin \
--admin-password MyP@ssw0rd! \
--sku-name B_Gen5_1 \
--version 10.5
Replace MyResourceGroup, mymariadbserver, and credentials with your values.
2. Configure Firewall Rules
Allow your client IP address to connect:
az mariadb server firewall-rule create \
--resource-group MyResourceGroup \
--server-name mymariadbserver \
--name AllowMyIP \
--start-ip-address 203.0.113.5 \
--end-ip-address 203.0.113.5
3. Connect to the Server
Use any MySQL client. Example with mysql client:
mysql -h mymariadbserver.mariadb.database.azure.com \
-u myadmin@mymariadbserver \
-p
After logging in, create a test database:
CREATE DATABASE testdb;
USE testdb;
CREATE TABLE hello (id INT PRIMARY KEY, msg VARCHAR(50));
INSERT INTO hello VALUES (1,'Hello Azure MariaDB');
Next Steps
- Configure Geo-Redundant Backups
- Enable SSL enforcement
- Set up Monitoring with Azure Monitor
- Scale compute/storage as needed
Explore the Advanced Topics for deeper configuration.