Connecting to forge database (mac)

May 06, 2024

image

I just recently learned how to connect to my Laravel Forge database for a production site, so I figured this would make a perfect blog post!

The first steps would be logging into your Forge account, and selecting the server that you would like to connect to. After completing those steps the next would be to go to the database tab of the server.

image

Copy this link, and then paste it into your web browser.

image

Click on open table plus, which should then automatically open up your table plus application. Your going to get an error, but thats ok! Just click on "edit connection" so we can enter in our correct credentials.

image

After your have clicked "edit connection" your going to presented with this box of credentials for the MySQL connection

image

Now we just need to add 2 things; our database password and our ssh key.

Your password is going to be located in your environment tab inside the site on your server.

image

Just copy the value for "DB_PASSWORD=" into the password input for the database.

image

Now last but not least is adding your ssh key!

image

Just click "import a private key" Then go to your ".ssh" directory in your home folder Select "id_rsa" and thats it!

image

Next just click "test" at the bottom and if you got green your good to go! If not, make sure you follow the steps correctly and have entered the corrected information!

image

It's really that easy!

Welcome to z0mbieblog

April 29, 2024

This is a blog that I am actively working on, and I am going to be posting solutions to coding problems that I encounter during my web development career. I hope that one day one of these posts will help someone! Going to shoot for 1 post a week minimum, so stay tuned!

image