—START HERE—
Follow this guide to install and start securing MariaDB on Ubuntu desktop 20.04.
- Update Ubuntu 20.04 and install MariaDB Server.
sudo apt-get update
sudo apt-get install mariadb-server
- Secure the MariaDB installation by running the included security script.
sudo mysql_secure_installation
Press Enter
You will be prompted to set a root password. Input Y and input the new password for root and validate it.
The Next prompt will ask if you want to remove anonymous users. Input Y
Prompt will request input to disallow remote root login. Input Y
Prompt will request input to remove the test database and access. Input Y
Last prompt will request input to reload the privilege tables. Input Y
Login to the MariaDB server and confirm its running.
sudo mariadb
Enter the password you decided on for root during the first prompt.
Create user to access DB other than root.
GRANT ALL PRIVILEGES ON *.* TO ‘sqladmin’@’localhost’ IDENTIFIED BY ‘password_here’;
quit;
End
You should always harden your servers.
Some useful links:
Secure your MariaDB installation – https://mariadb.com/kb/en/securing-mariadb/
Ubuntu Security and Server hardening – https://ubuntu.com/security