By default MariaDB comes with a shell script called
mysql_secure_installation that allows you to:
- Set a root password
- Remove anonymous database users
- Disallow remote login as
root(you can tunnel through SSH instead)
- Remove the
But for some reason it isnʼt shipped with the MariaDB 10 version installed through Synologyʼs Package Center. Nothing a few lines of shell script cannot fix. Login to your NAS via SSH and run the following commands:
# Latest MariaDB package version on Synology as of writing is 10.3.27
# Command changed to `mariadb` in MariaDB 10.6.2
mariadb_version="$($mariadb_command --version | grep -oP 'Distrib \K[\d.]+')"
# Get the script matching the installed MariaDB version
chmod +x mysql_secure_installation.sh
# 'basedir' is the installation location of the MariaDB package
As always, check any scripts you download from the Internet before running them on your system!