How to prevent any external logins to my Mysql database?
That is, how to make sure that the only way my database could be manipulated is to login to my machine with SSH and work as root/sudoer.
My machine is Ubuntu server operated and I've already deleted PHPmyadmin so people couldn't try to login from port 80 or 443 when I'm on HTTPS, but I think people can still try to login with software like Mysql workbench or similar software, and I wish to prevent that as well and to actually lock my database so only my operating system's root user/sudoer could access the DB via
mysql -u root -p.
To clarify, I wish that other DB users couldn't login either from my system or outside, with their passwords --- I'm the only one who uses this machine but even if there where other machine users besides root/sudoer, I would still want them not to be able to login to Mysql, and I don't want anyone to login from outside the machine as well - In other words, I don't want any other human besides me, to manipulate the database.
I assume I should lock some extra ports besides 3306. Is that correct?
I could remove any such port from these lists in
# Allow incoming TCP ports TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,9000" # Allow outgoing TCP ports TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995,9000"
Note: I've unfiltered port 9000 for PHP-FPM.