$blog++

How to connect to you database using Vagrant

Jan/05/2014 2 min read by Marco Monteiro

As you may or may not know, I started to really use vagrant lately. The installation process to get a PHP development environment is quite easy. However, there was a few moment were I run into a small issues. Most of them happened just because my mind was still programmed to work with a simple Lamp stack.

One of the issues that made me lose 20 minutes or so was connecting SequelPro to the database. Sure I installed PHPmyAdmin but I wanted to use my own database management app.

All you need to do is create a SSH tunnel to your server. Todo so, you need to use the following settings.

Server name: "YourServerName" (doesn't really matter)
MySQL Host: 127.0.0.1
Username: root
Password: ******
Database: 
Port:
SSH Host: 192.168.56.101
SSH User: vagrant
SSH Password: vagrant (this is the default one)
SSD Port: 

Your first impulse might be to connect using the virtual machine IP as your normal host like I did, but that obviously will not work. Also, took me a while to find out the SSH password, but that happened mostly because I was reading the documentation while I was using it.

x

Like it? Tweet it.

"How to connect to you database using Vagrant" via @marcogmonteiro