I have a VPS and I'm trying to have remote access to my mysql databases.

I granted root privileges to any IP address


I commented in the my.cnf file, the line

#bind-address =

I restarted mysql

sudo service mysql restart

But the next step (all the tutorials around mention as such) involves iptables to forward requests from port 3306; and I realise that my VPS doesn't even have iptables since sudo service iptables status outputs iptables: unrecognized service

I could install iptables, but may I achieve the same with nginx? That is, this fort forwarding to allow remote access to my mysql databases?


No, Nginx and Netfilter are two completely different things.

You configured your MySQL database in an alarmingly open manner, which might be dangerous. A better option might be to restrict access to it only from the application (a webserver?), and not the whole Internet. To do so, replace the % by the addresses of this client.

You asked about setting additional firewall rules with the iptables tool of the Netfilter subsystem, which is good. If the tool is not installed, why not installing it?

Nginx, whoever, is a webserver, which you probably sooner or later need anyway. But it is in no way whatoever a replacement for Netfilter.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.