Download and install DBeaver from here.
Make sure to access your server via SSH before continuing.
To execute SQL code in the server run
We need a new user to access the database. We can create one by running
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'droplet_ip_address' IDENTIFIED BY 'password';
DON'T COPY PASTE THE ABOVE CODE! 'password' IS NOT A REAL PASSWORD! CHANGE 'admin', 'droplet_ip_address' AND 'password'!
Make sure that your private key is ready (DBeaver does not like OPPENSSH).
Open DBeaver workbench and initialize a new connection:
Your default connection settings should look like this:
Under Authentication (Database Native) type in the credentials of the user we created on top (I created a user called 'admin').
For SSH, set the authentication method to "Public Key" and under "Private Key" search for the private key associated with your droplet. Your passphrase was asked for when you created the key (or when you converted the key to RSA format).
Test the connection. If you connected successfully you should see the following: