Connecting to MySQL running in a vagrant box

Posted . Visible to the public.

If you want to use something like Sequel Pro to connect to a database running within a vagrant vm you need to edit the /etc/mysql/my.cnf file and change the bind-address setting from 127.0.0.1 to 0.0.0.0 and restart mysql. sudo service mysql restart.

Then you will be able to set up the connection. With Sequel Pro you'll want to set the private key using the ~/.vagrant.d/insecure_private_key option in the ssh connection settings. Then typically it's user vagrant password also vagrant

Andy Henson
Posted by Andy Henson to Foxsoft (2017-08-01 14:32)