MariaDB is a fork of MySQL, and it is fully compatible with MySQL. To install MariaDB on Debian 11, you can use the apt package manager that comes with Debian. Here’s one way to do it:
- Update the package list:
sudo apt update
- Install the MariaDB server package:
sudo apt install mariadb-server
- During the installation, you’ll be prompted to set a root password for the MariaDB server. Make sure to choose a strong and secure password.
- After the installation is complete, you can check if the MariaDB service is running:
sudo systemctl status mariadb
- If the service is not running, you can start it with the following command:
sudo systemctl start mariadb
- To make sure MariaDB starts automatically after reboot, enable the service:
sudo systemctl enable mariadb
Once the installation is complete, you can use the mysql command-line client to connect to the MariaDB server and perform various tasks, such as creating databases, tables, and users.
It’s highly recommended to secure your MariaDB installation by running the mysql_secure_installation script, this script will guide you through the process of setting a strong root password, disabling remote root login, and removing test databases.
Please make sure to back up your data, before making any changes or upgrading your MariaDB server.
Also, the process of installing MariaDB is similar to installing MySQL, so you can use the same commands and tools to manage and maintain both MariaDB and MySQL.