In this write-up, we will learn the installation of MariaDB on Debian 11 using the command line method.
How to install MariaDB on Debian 11
We will learn the installation of the latest version of MariaDB that is 10.6 on Debian 11. Before installation we will update and upgrade the repository of Debian 11, to update.
After the update, upgrade the repository so the packages which needed upgrading can be upgraded.
Install the dependency package of MariaDB.
We will import the key of the installation package of MariaDB from its official website.
The key which is imported now added to the repository of Debian 11 as
Update the repository again.
Install MariaDB.
Once the installation of MariaDB is complete, start and enable it. Start it with the command of systemctl.
To enable it so that it can automatically start on reboot.
To verify the running status of MariaDB, we will check its status.
It is confirmed from the status, MariaDB is successfully installed as well as running. Now to make it secure, we will execute the command.
Set any password, for example, in our case we are setting the password. Once the password is set, a successful message will display and it will ask whether to switch to the unix_socket authentication, type “n”, because the unix_socket authentication is the passwordless security mechanism.
It will ask to change the root password, if you don’t want to change press “n”.
Next, it will ask for the removal of an anonymous user, type “Y” to remove them.
Type “Y”, to disallow root login remotely.
Remove the test database and access it by typing “Y”.
Reload the privileges table now by answering it with “Y”.
Now to verify the security we will run the following command to enter the environment of MariaDB and then type the set password to access it.
To check the version of MariaDB we will type.
Exit from MariaDB.
Conclusion
One of the reasons for the popularity of MariaDB is its compatibility with MySQL which allows its users to easily shift their databases from MySQL to MariaDB. This write-up is about the installation procedure of MariaDB on Debian 11 using the terminal. We simply imported the key from the official website of MariaDB and added it to the repository of Debian bullseye. After the installation, we started and enabled it and verified this by confirming its status. Finally, we configure its basic settings and run MariaDB to check its installed version.