Problem:
Configure SequelPro connection over SSH to MySQL running on a Vagrant box.
Solution:
- Set up vagrant VM with MySQL database and user as usual.
- Add Host entry for VM to .ssh/config. Not strictly necessary, but also allows standard SSH connections, piping, etc:
# 'vagrant' as alias for the host Host vagrant # Values from vagrant ssh-config HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile $HOME/.vagrant.d/insecure_private_key IdentitiesOnly yes LogLevel FATAL
- SequelPro setup
- Use SSH connection type
- MySQL Host: 127.0.0.1
- Username: <MySQL user on VM>
- Password: <MySQL password on VM>
- Database: <MySQL database VM>
- Port: <MySQL port on VM>
- SSH Host: vagrant
- SSH User: vagrant