Reputation: 298
I've installed Laravel Homestead on Vagrant via the 'per project' method outlined here: https://laravel.com/docs/5.3/homestead#per-project-installation
I can access the project database via ssh but want to be able to connect to it via my db editor (Coda).
My project root is ~/Code5
and my ~/Code5/Homestead.yaml
file looks like this:
---
ip: "192.168.10.10"
version: "0.3.3"
memory: 2048
cpus: 1
hostname: code5
name: code5
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: "/Users/me/Code5"
to: "/home/vagrant/code5"
sites:
- map: super.app
to: "/home/vagrant/code5/app/super/public"
databases:
- super_db
Accessing super_db
via ssh looks like this...
my-mac:~ me$ cd ~/Code5
my-mac:Code5 me$ vagrant ssh
vagrant@code5:~$ mysql --user=homestead --password=secret
mysql> use super_db;
mysql> show tables;
(tables listed successfully)
But If I try use this login config in Coda to access my database...
Server: 127.0.0.1 (port 33060)
User: homestead
Pass: secret
...I can't get it to connect.
(which is how I would connect on a global Homestead install, as opposed to a 'per project' method)
Also tried...
Server: code5 (port 33060)
User: homestead
Pass: secret
FYI: I needed to install Homestead via the 'per project' approach as I needed to run an older version of Homestead (that runs php5) without messing with my current global installation of homestead box (which runs php7). This way I can vagrant up either the php5 or php7 box and get developing.
Upvotes: 2
Views: 577
Reputation: 298
Ok, figured it out, used the IP from the Homestead.yaml file and changed the port back to the default (3306, not 33060) e.g.
Server: 192.168.10.10 (port 3306)
User: homestead
Pass: secret
Upvotes: 4