The MariaDB database is a multi-user, multi-threaded SQL database server that consists of the MariaDB server daemon ( mysqld ) and many client programs and libraries.
When it comes to relational databases, MariaDB is considered as one of the most popular out of these. It has been developed by the makers of MySQL database management system and is designed to be compatible with all the three major operating systems i.e. Linux, macOS, and Windows.
Since Debian 10 is one of the lightest distributions of Linux, that is why most of the users prefer using it for performing their day to day tasks.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform MySQL installation tasks on Linux.
In this context, we shall look into methods to install MariaDB on Debian 10.
How to install MariaDB on Debian 10 ?
To install MariaDB on a Debian 10 system, we will quickly walk you through the below mentioned simple steps.
1. Update the Cache of your Debian 10 System
As with the installation of any new package, you have to update your system’s cache first.
Similarly, we will update our Debian 10 system's cache by running the following command:
$ sudo apt update
This will update all the packages and dependencies on the system.
2. Install MariaDB Server on Debian 10
Now you have to start the installation process of the MariaDB server on Debian 10 with the help of the following command:
$sudo apt install mariadb-server
On running this command, your Debian 10 system will immediately begin the installation of the MariaDB server on it, however, during the installation, it will ask you once for your consent. Then you have to type 'Y' to continue the installation.
Once you have provided this consent, now the control of the terminal will only be handed back to you once the installation is complete.
3. Start the MariaDB Service on Debian 10
On some distribution of Linux, the MariaDB service starts automatically after installation whereas, in others, you have to start it manually.
However, it is always good to be on the safe side so you can always start the MariaDB service manually by running the command stated below:
$ sudo systemctl start mariadb
If the MariaDB service is started successfully, you will not be getting any messages on the terminal.
4. Check the Status of MariaDB Service to Verify its Installation: (Optional)
Therefore, to verify if the MariaDB service is installed and started successfully, you have to check the status of this service by running the following command:
$ sudo systemctl status mariadb
If the status of the MariaDB service is "active (running)" then this implies that it has been successfully installed and started on our Debian 10 system.
5. Check the Version of MariaDB Server: (Optional)
You can even check the version of the installed MariaDB server by running the command shown below:
$ mariadb --version
This command will display the version of the MariaDB server installed on our Debian 10 system.
6. Secure your MariaDB Server: (Optional)
i. Additionally, you can even secure your MariaDB server by running the command stated below:
$ sudo mysql_secure_installation
Here, You will be asked to enter your root password.
ii. After entering the root password, you will be asked if you want to change it or not. In our case, since we did not want to change it, that is why we pressed the "n" key. You can do otherwise if you wish to change your root password.
iii. MariaDB creates an anonymous user by default for testing purposes. However, when it comes to securing your MariaDB server, it is always good to remove that user.
So here, you have to enter "Y".
iv. Then it is strongly recommended that you always disallow remote root logins for an added layer of security. Therefore, you need to enter a "Y" over here as well.
MariaDB even creates a test database by default at the time of installation.
You should also remove this database and access to it. So, you should enter a "Y".
v. Finally, you will be asked to reload the privileges table so that it can easily read all the changes that you have just made.
Therefore, you need to press "Y" over here yet again.
vi. Once you have configured all these settings, you will be presented with the message on your terminal which will indicate that your MariaDB server has been secured successfully.
How to uninstall MariaDB from Debian 10 ?
To remove MariaDB from your Debian 10 system along with its configuration files, you have to run the following command:
$ sudo apt-get purge mariadb-server
This command will remove MariaDB along with all of its configuration files from your Debian 10 system.
Also, you might also want to get rid of all those packages that got installed along with MariaDB.
This can be done by executing the following command:
$ sudo apt-get autoremove
After running this command, you will not be able to find any traces of MariaDB on your Debian 10 system.
[Need urgent assistance to install Packages on Debian Linux Server ? We are available to help you. ]