Install MariaDB with phpmyadmin and secure the access to it with .htaccess

Install and secure MariaDB:

apt install mariadb-server
Install phpmyadmin:
apt install phpmyadmin
Configure phpmyadmin access. Open /usr/share/phpmyadmin/.htaccess and fill it with:
Protect Directory
AuthName "Dialog prompt"
AuthType Basic
AuthUserFile /usr/share/phpmyadmin/.htpasswd
Require valid-user
Create a user admin with password with following command:
htpasswd -c /usr/share/phpmyadmin/.htpasswd admin
Final configuration. Open /etc/apache2/conf-available/phpmyadmin.conf and add to the target directory:
AllowOverride All
Finally, restart Apache:
systemctl restart apache2.service