Step 1 : we’ll install the mariadb-server package:
sudo apt install mariadb-server -y
Step 2 : After you install the mariadb-server package, check to make sure the service started and is enabled. By default, it should already be running:
systemctl status mariadb
Step 3 : Next, we’ll want to add some security to our MariaDB installation
Step 4 : At this point, we haven’t set a root password yet, so go ahead and just press Enter when the script asks for it. This script will ask you additional questions.
The entire process after executing mysql_secure_installation looks like the following:
Enter current password for root (enter for none): Set root password? [Y/n] Remove anonymous users? [Y/n] Disallow root login remotely? [Y/n] Remove test database and access to it? [Y/n] Reload privilege tables now? [Y/n]
Step 5 : we’ll use the mariadb command to access the MariaDB shell
Step 6 : The MariaDB shell prompt will look like this:
We’ll get into MariaDB commands and user management later. For now, you can exit the shell. To exit, you can type exit and press Enter or press Ctrl + D on your keyboard.