Restricting MySQL access by port
I'm almost embarrassed to ask this because it feels like a day 1 noob question.
I noticed my MySQL error log has a lot of failed access attempts, which I assume are robots trying to brute force access.
I don't have any remote servers that need to access any of my servers databases anymore, so I think I can restrict access by port. The plan is to:
1. In CSF, block port 3306; and
2. In my.cnf, add "bind-address=127.0.0.1"
Here's the stupid question. By doing this, I'll JUST be blocking remote servers from logging in to MySQL, right? Scripts on the same server as MySQL would still be able to access it normally and show content as usual?
I was about to make these changes, then suddenly panicked that I would be blocking myself out of the server :-O Or worse, blocking everyone from seeing scripts that use MySQL content and not realize it.
-
It will run just fine you local connections should be connecting via localhost. You do not need the " In my.cnf, add "bind-address=127.0.0.1" and if you need remote access later you just add the ip of the remote machine the the csf.allow 0 -
Hello :) MySQL will still function for local connections, but you will need to whitelist IP addresses for users that connect to their databases from external servers. Thank you. 0
Please sign in to leave a comment.
Comments
2 comments