Browse Author

Andrews Ang

How to setup phpMyAdmin in Homestead

Writing this for my own reference. Hope it helps someone too.

Install using Ubuntu repository:

This will install phpMyAdmin from Ubuntu’s repositories.¬†Assuming that your projects live in /home/vagrant/Code:

  1. On your hosting machine, open a terminal, go to your homestead folder, after “vagrant up”, enter “vagrant ssh” to ssh to your virtual machine.
  2. Then enter “sudo apt-get install phpmyadmin” (Do not select apache2 nor lighttpd when prompted. Just hit tab and enter.)
  3. You will be prompted whether to set up a database, select “OK” and when prompted for password, enter “secret”. (This is the default password for Homestead’s MySQL.)
  4. Now enter “sudo ln -s /usr/share/phpmyadmin/ /home/vagrant/Code/phpmyadmin”
  5. Finally, enter “cd ~/Code && serve phpmyadmin.app /home/vagrant/Code/phpmyadmin”

For Mac/Linux users, follow the following step to add a nice URL for phpMyAdmin.

  1. On your hosting machine, edit¬†the /etc/hosts file with the command “sudo nano /etc/hosts”. I like the nano editor, feel free to use any editor.
  2. Add the following (you can use your virtual machine’s IP address instead of 127.0.0.1):
    • 127.0.0.1 phpmyadmin.app
  3. If you’re using nano editor, press keys Control + o (letter o) to save the changes. Then press keys Control + x to exit the editor.
  4. Now open a browser.
  5. Go to http://phpmyadmin.app
  6. That’s it!

Reference:

http://stackoverflow.com/questions/23788096/how-to-setup-phpmyadmin-on-a-laravel-homestead-box