MySQL is an open-source relational database management system (RDBMS).
Since MariaDB is a fork of MySQL, the database structure and indexes of MariaDB are the same as MySQL.
MariaDB is a free and open-source relational database management system (DBMS) which is considered as a successor and replacement of MySQL DBMS.
This DBMS is available for all three major operating systems i.e. Linux, macOS, and Windows.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform installation of MariaDB on Linux.
In this context, we shall look into the steps to install MariaDB on Linux Mint 20.
Steps to install MariaDB on Linux Mint 20 ?
To get MariaDB installed on your Linux Mint 20 system, the following steps should be performed in the order specified below:
1. Updating the Linux Mint 20 System's Cache:
Before installing MariaDB, we need to update our system's cache which can be done as follows:
Click on the Command line tool shortcut icon of the terminal present on your taskbar.
Now you can update your system’s cache with the following command:
sudo apt update
It will take a few seconds for the updating process to complete after which you will be given the control back to run the installation command.
2. Installing MariaDB on Linux:
After updating your system, you can install MariaDB on it by running the command stated below:
sudo apt install mariadb-server
You will be asked to confirm if you want to continue with the installation or not. You need to type "Y" to proceed.
3. Verifying the Status of MariaDB:
After installing MariaDB, it starts running automatically, however, you can always verify it by checking its status by running the following command:
sudo systemctl status mariadb
If MariaDB service will be currently running, then you will be able to see the "active (running)" status.
4. Checking the Version of MariaDB:
Additionally, you can also confirm the installation of MariaDB by checking its version by running the following command:
sudo mysql –v
The version of MariaDB installed on our Linux Mint 20 system will be displayed.
5. Securing MariaDB:
Up till now, MariaDB has been successfully installed on your Linux Mint 20 system.
i. This step is optional, however, it is recommended that you secure your MariaDB by running the following command:
ii. When you will run this command, you will be asked to enter the root password for MariaDB. Since we have just installed MariaDB and have not set up a password for it yet, therefore, we can simply press the Enter key.
iii. After doing this, we will be asked if we want to set up a password or not. Press “Y” over here for setting up a password. Then you will be asked to enter a password of your choice.
iv. Once your password is set up, you will be asked if you want to remove the anonymous user (a user created by default) or not. It is recommended that you do so by pressing "Y".
v. Then you will be asked if you want to disallow the access of MariaDB root remotely or not. You should press "Y" over here for blocking remote access to MariaDB root for security purposes.
vi. There is also a default test database created which you should remove before using MariaDB. You can remove it by pressing "Y" when asked to remove the test database.
vii. Finally, you will be asked to reload the privilege table by pressing "Y" so that all the changes that you have made so far can take effect.
6. Connecting to MariaDB:
For connecting to MariaDB, you can run the following command in your terminal:
sudo mysql –u root –p
After executing this command, you will be asked to enter the root password that you have previously set up. Once you enter that password, you will see the MariaDB shell on your terminal.