Installing MariaDB and secure it on Debian

Published on


MariaDB is one of the best relational databases and we can use it on Debian Linux to host databases for apps, blogs, and websites. In this article we’ll learn installing MariaDB and securing it on Debian.

MariaDB on Debian

1. Refresh the system once.

sudo apt update

2. Install MariaDB server.

sudo apt install mariadb-server

3. Secure it.

sudo mysql_secure_installation
Enter current password for root (enter for none): Hit Enter
Set root password? [Y/n] ------------------------ Y
Remove anonymous users? [Y/n] ------------------- Y
Disallow root login remotely? [Y/n] ------------- Y* or N*
Remove test database and access to it? [Y/n] ---- Y
Reload privilege tables now? [Y/n] -------------- Y

* You can either allow or disallow root login remotely. It is recommended to disallow it for safety, but you can use root user too if you wish to, so use your own decision based on your use.

You’re done installing MariaDB and secured it. Just use it.

Published in: .

Leave a Reply

Your email address will not be published. Required fields are marked *