If you are running WordPress and are migrating from a traditional hosting to AWS Lightsail instance, you may be wondering “how on earth do I access phpMyAdmin to see my database?”
Step 1
Make sure you have your Private Key and path handy. The Private Key is sometimes called the .pem file. If you have it already, go to Step 2. If you do not have it, in your Lightsail Dashboard:
1. Go to your Account page under the SSH Keys tab, click the Download link; or
2. Go to Manage Instance, under the Connect tab. In there you will see a link to download the Private Key from the Account page. Click there and download.
Keep your Private Key in a folder where you know the path.
STEP 2: Create SSH Tunnel (For Mac users)
Open the Terminal window on your Mac (Eg. “Finder -> Applications -> Utilities -> Terminal”). At the command prompt, type in this command and press enter:
ssh -N -L 8888:127.0.0.1:80 -i /path/key.pem bitnami@PublicIP
(Replace the path and .pem filename accordingly. Replace PublicIP with the Fixed IP address as provided by AWS Lightsail.)
Sometime you will see this message in your Terminal:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
WARNING: UNPROTECTED PRIVATE KEY FILE!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for ‘/path/key.pem’ are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key “/path/key.pem”: bad permissions
Permission denied (publickey).
If you see this message, type in the following command:
sudo chmod 600 /path/key.pem
(replace the path and .pem filename accordingly.)
In your browser, go to: http://127.0.0.1:8888/phpmyadmin/
If successful, you should be able to see phpMyAdmin login page. But you may be wondering…. what is the ID and password to login?
STEP 3:
For the user ID, try “root” or “bitnami”.
In order to get the password, go to manage instance in your AWS Lightsail dashboard under the Connect tab. Click on the “Connect using SSH” button and run the following command:
cat bitnami_application_password
And voila! Your password appears!