What is MariaDB?
MariaDB is an open-source relational database management system (RDBMS) that serves as a drop-in replacement for MySQL.
It is known for its high performance, stability, and advanced security features.
How to install MariaDB?
You can install MariaDB using your system’s package manager.
Below are the steps for the most common Linux distributions.
Debian
-
Update the package list
-
Install software-properties-common
sudo apt install software-properties-common -y
-
Add the official MariaDB repository
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64] http://mariadb.mirror.server/location mariadb-11.4 main'
-
Install MariaDB
sudo apt update
sudo apt install mariadb-server -y
-
Secure the installation
sudo mysql_secure_installation
Follow the prompts to:
- Set a strong root password
- Remove anonymous users
- Disallow remote root login
- Remove the test database
Ubuntu
-
Update packages
-
Install MariaDB
sudo apt install mariadb-server mariadb-client -y
-
Start and enable MariaDB
sudo systemctl start mariadb
sudo systemctl enable mariadb
-
Run security configuration
sudo mysql_secure_installation
Fedora
-
Install MariaDB
sudo dnf install mariadb-server -y
-
Start and enable the service
sudo systemctl enable mariadb
sudo systemctl start mariadb
-
Run security script
sudo mysql_secure_installation
Verify the Installation
Check that MariaDB is running:
sudo systemctl status mariadb
Login to the MariaDB shell:
If you can log in and run:
then MariaDB is installed successfully.
Enable Remote Access (Optional)
-
Edit the MariaDB configuration file:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
-
Find the line:
and change it to:
-
Restart the service:
sudo systemctl restart mariadb
Security Best Practices
- Always use strong passwords for all accounts.
- Disable remote root login.
- Use SSL/TLS for encrypted connections.
- Regularly update MariaDB to the latest stable release.
- Apply CNIL and GDPR recommendations if handling personal data.
Next Steps
- Learn how to create databases and users
- Configure user privileges
- Enable data encryption at rest and in transit
- Integrate MariaDB with your web applications (Symfony, Laravel, etc.)
✅ MariaDB is now ready to use on your system!