in Laravel

MySQL Workbench And Homestead

If you do Laravel development then you most likely are using Homestead for your local development environment, if you're not using Homestead then I can't recommend it enough to get you started. Homestead is a package you can install with your Laravel project which will create a virtual machine using Vagrant you can use for your development environment. This means you can have a web server up and running in seconds without having to install PHP and Nginx/Apache on your computer. If you want to learn more about Vagrant and Homestead please visit the following tutorials

Homestead Hostname

First, you need to get the Homestead IP address, you can see this from your Homestead config file Homestead.yaml

ip: ""
memory: 4000
cpus: 1
provider: virtualbox

At the top of the Homestead.yaml file you'll see the above, as you can see our Homestead IP address is, we'll need to use this with MySQL Workbench to connect to your Homestead box via SSH.

MySQL Workbench Connection

Create a new connection within MySQL Workbench and select the connection method to be Standard TCP/IP Over SSH. Enter the SSH Hostname as your IP address The SSH Username is vagrant. The SSH Password is vagrant. The MySQL Hostname is which is the localhost from the Homestead box. The MySQL Post number we're using is going to be 3306. The MySQL Username is homestead. And finally, the MySQL Password is secret.

Now, test your connection and you should be able to view the database successfully.

Subscribe To The Weekly Newsletter

Get weekly updates to your email