Report this

What is the reason for this report?

What iptables entries for secure MySQL?

Posted on July 5, 2013

I want to add Ubuntu iptables entries so only the following can access MySQL server on my droplet:

  • my Rails app on that same droplet should be able to get, post, update, delete, etc data on MySQL on that same droplet
  • I should be able to SSH to my droplet and use MySQL.

What iptables entries will make these secure restrictions possible?

Thanks in advance!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Make sure that in <strong>/etc/mysql/my.cnf</strong> you have the following entry: <br><pre>bind-address = 127.0.0.1</pre>

Are they on the same droplet?

Yes, everything is on the same droplet.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.