Manual mysql_secure_installation on QNAP

       167 words, 1 minutes

I have installed the SQL server on my QNAP TS-453mini but couldn’t find the mysql_secure_installation script. As far as I understood it, it simply changes the root password, disable remote sensible access and deletes the test database. So I decided to run the commands manually inside phpMyAdmin.

What is required is the “SQL server” and “Web Server” from the “Applications” section. Enable both services and don’t forget HTTPS on port 8081. Then install “phpMyAdmin” from the “App Center”. When it’s done, just log in using the root / admin credentials.

Browse to the “SQL” tab and enter the following commands:

UPDATE mysql.user SET Password=PASSWORD('NewPassw0rd') WHERE User='root';
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
/*DROP DATABASE test;*/
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
FLUSH PRIVILEGES;

Click the “Go” button and everything should go smooth. In my case, I had a “DROP not allowed” message. So I manually drop the table.

And that’s all, MariaDB is now “secured”.