Securing MariaDB with mysql_secure_installation
The simplest way to add a bit of extra security to our MariaDB installation is just a command line away.
How to do it...
To secure a default install of MariaDB, perform the following steps:
Open a terminal and run the following command:
mysql_secure_installation
As prompted by the script, set a password for the
root
user, disallow remoteroot
logins, and remove anonymous users.Since we've been using the
test
database for various recipes in the current and other chapters, we may not want to remove it when prompted.Reload the privilege tables when prompted.
How it works...
The mysql_secure_installation
program is actually just a script written in PERL. Its sole purpose is to apply some basic security settings that nearly every MariaDB installation should have. This script should be run first thing after installing MariaDB on a server. It takes only a minute and should be considered as an essential step that we must perform whenever we install MariaDB...