Vim & Vim Adventures
August 24, 2021Updating A Primitive Type Variable From A Service In Angular
September 6, 2021Sometimes a client wants to see the structure of the database, or you need an easy way of editing something small (For example a user's role). In the above-mentioned examples, it is always best to use a GUI interface than using the terminal. Here I am going to give the steps on how to connect your Laravel Forge remote database in DBeaver.
SSH Key
First, you will need to set up your SSH key:
- Login to ForgeÂ
- Then click on the drop-down labeled "Servers" and select the server you need to connect to
- Then click on the SSH Keys button on the left panel
- Next, we will add a new key by filling out the form with the name (example YOUR-NAME DEVICE ) and your public key (you will find your public key in 'C:\Users\YOUR-USERNAME\.ssh\id_rsa.pub' ) then click add.
DBeaver Setup
First, you will need to install DBeaver. You can download DBeaver here.
Once DBeaver has been installed open DBeaver, go to the new connection icon on the top left  and then select MySQL. On the main tab, you need to fill out the following information, you can find all the information on Forge.
- Server Host = DB_HOST
- Database = DB_DATABASE
- Username = DB_USERNAME
- Password = DB_PASSWORD
How to find the information on Forge?
Once logged in click on the dropdown labeled 'Sites' and select that is connected to the database you would like to look at. Then select environment on the left panel and copy the database information into DBeaver as shown above.
Next, you will need to go to the SSH tab in DBeaver and click on the checkbox 'Use SSH Tunnel'. The fill out the following:
- Host/IP - This you will find at the top of the sites page on Forge
- User name = forge
- Authentication method - select Public Key
- Private Key - select the folder icon and then select this file 'C:\Users\YOUR-USERNAME\.ssh\id_rsa.pub'
Now select Finish and your new collection will be listed on the left pane.
DBeaver Tips
- If you want to edit an entry double click on the entry, do your change, and then press ctrl + s to save your changes
- To refresh a table to see if there are any updates press F5.
Happy Coding!