Posts tagged Secure Mysql Service

How to enable Mysql 3306 port for a particular IP and deny for all ?

If you want to disable the Mysql Access for all IPs except your ip then follow the below steps :

[email protected][#] vi /etc/csf/csf.conf

Then search for the line :
# Allow incoming TCP ports
and the remove the port : 3306

and also search for the line :

# Allow outgoing TCP ports
and remove the port : 3306

Save and Quit.

then open the csf.allow file

[email protected][#] vi /etc/csf/csf.allow
and add the entry as :

tcp:in:d=3306:s=10.10.10.10

And then restart the CSF service

[email protected][#] csf -r

Note : Replace 10.10.10.10 with the IP for which you want to Allow access.

That’s all you are done.