mysqlamazon-web-servicesubuntumysql-workbenchamazon-lightsail

Access Lightsail Instance's database with MySQL Workbench


I have an Amazon Lightsail Ubuntu multi WordPress site set up with bitnami stack.

enter image description here

I'm looking for a way to access the Instance's database on Amazon Lightsail with MySQL Workbench remotely.

Please note that I do not have a seperate Lightsail database, as I'm trying to do things as cheaply as possible at the moment. So the following guide is not applicable to me.

Connecting to your MySQL database in Amazon Lightsail

According the wp-config.php MySQL database is using localhost:3306

I have static IP address 3.230.xxx.xxx. I have taken the DB username and password from the wp_config.php file.

I've entered the details.

enter image description here

I wonder if anybody else has managed to connect to an Instance's database, rather than a seperate database.

enter image description here

If this is not possible I wonder if there are any suggestions as how to best access this Instance's database remotely.


Solution

  • Found the answer using a similar youtube video which is used to connect to phpMyAdmin.

    https://www.youtube.com/watch?v=9VdcQLDmYII

    Basically you need to use Putty SSH tunneling in order to connect to the MySQL instance

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    Also found a second method

    Within the MySQL Workbench you can change the connection method to `Standard TCP/IP over SSH'. Gave the SSH key and the relevant details on connection was accepted

    enter image description here