/Developer Environments

Connecting to a Vagrant Box using SSH for FTP and MySQL

What this post will go over is how to connect to a FTP and MySQL server using a Vagrant environment provided by a PuPHPet VM.


What you’ll need:

  • Vagrant installed
  • A PuPHPet local VM set up (in this example I run CentOS 6.4)
  • a MySQL database management software (in this example I use MySQL Workbench)
  • a FTP client (in this example I use FileZilla)

Depending on your PuPHPet configuration your local VM IP address and MySQL username/passwords may be different. Connecting to FTP using FileZilla:

  • Host: Local VM IP Address (set in PuPHPet)
  • Protocol: SFTP
  • Logon Type: Normal
  • User: vagrant (the default username)
  • Password: vagrant (the default password)
  • Default remote directory: /var/www/html

Connecting to MySQL using MySQL Workbench:

  • Connection Method: Standard TCP/IP over SSH
  • SSH Hostname: Local VM IP Address (set in PuPHPet)
  • SSH Username: vagrant (the default username)
  • SSH Password: vagrant (the default password)
  • MySQL Hostname: 127.0.0.1
  • MySQL Server Port: 3306 (default MySQL port)
  • Username:root
  • Password: MySQL Root Password (set in PuPHPet)

By default the MySQL Hostname is set to 127.0.0.1, however if you need to find this address in case it is changed in your setup you can SSH into your Vagrant VM and use the following command:

  • cat /etc/my.cnf | grep bind-address
  • If the above file does not exist try:
  • cat /etc/mysql/my.cnf | grep bind-address

Special thanks and more information:

Brandon Patram

Brandon Patram

Full Stack Software Engineer

Read More