we have two developers using Vagrant (which has it's own internal ip like: On RackSpace we have a percona database instance. We would like to allow read/write access to that database from those vagrant boxes. I've never done this from vagrant boxes and was hoping someone could lend support.

The below commands are what I've issued thus far:

sudo iptables -A INPUT -p tcp -s --dport 3306 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

sudo iptables -A OUTPUT -p tcp --sport 3306 -m conntrack --ctstate ESTABLISHED -j ACCEPT

sudo invoke-rc.d iptables-persistent save

First, you want to find out what external IP address the Vagrant boxes NAT to:

What is my IP - Google

Then add an iptables rule for that IP address.

Then you will want to grant access from your MySQL database to the host (The Vagrant box)

ON database.*
TO 'user'@'vagrantboxremotehost'
IDENTIFIED BY 'password';

You can also use

TO 'user'@'%'

To allow from any IP, but that is not recommended.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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