WordPress on Google Cloud: Access phpMyAdmin and files

Unlike some typical WordPress host companies, there is no direct page on Google Cloud to access phpMyAdmin and WordPress files. In this post, I will provide a quick summary of the methods.

phpMyAdmin for WordPress on Google Cloud

  1. Download PuTTY and PuTTYgen from this website (click this to link to the website). They are free to download and use.
  2. On PuTTYgen, click Generate to generate a key.
    phpMyAdmin for WordPress on Google Cloud - Step of generate SSH key
  3. Save private key in your local folder. (Keep this window open as we are going back to copy it into Google SSH later.)
    phpMyAdmin for WordPress on Google Cloud - Step of save SSH key
  4. Click Edit on Google compute engine.
    phpMyAdmin for WordPress on Google Cloud - Step of edit SSH key on Google Cloud
  5. Find the section of SSH Key on the Google Cloud. Copy and paste the private key generated in Step 2 into Google SSH. Click ADD ITEM and the click SAVE the SSH key on Google.
    phpMyAdmin for WordPress on Google Cloud - Step of add SSH key to Google Cloud
  6. Assume you have downloaded PuTTY already (not PuTTYgen). Click Connection -> SSH -> Auth -> Credentials -> Browse the key file saved from Step 3. (The file extension is .ppk.)
    phpMyAdmin for WordPress on Google Cloud - Browse SSH key file in PuTTY
  7. Click Connection -> SSH -> Tunnels -> Type 8888 and localhost:443. Then, click Add.
    phpMyAdmin for WordPress on Google Cloud - Add Tunnels information on PuTTY
  8. Click Session -> Copy external IP from Google cloud engine and paste it at Saved SessionsSave and Host Name. (It seems you need to paste into both windows. Otherwise, there might be error. I am not very sure about this.)
    phpMyAdmin for WordPress on Google Cloud - Add External IP info into PuTTY Session
  9. Click Connection -> Data and copy the username appeared in front of the added Google SSH Keys (i.e., the one added in Step 2). After the steps of 3, 4, 5 being done, you can click “Open” button. (Double check if all info from these 4 steps are still there. Otherwise, redo any missing one.)
    phpMyAdmin for WordPress on Google Cloud - Add username into PuTTY
  10. Type https://127.0.0.1:8888/phpmyadmin on your web browser. If you use Bitnami WordPress on Google Cloud, you should be able to see bitnami-base-password at your Google Cloud instance. Note that, the user name is root, the default one shown on the web page. This is not your WordPress wp-admin user name and password.
    phpMyAdmin for WordPress on Google Cloud - Type Password into phpMyAdmin

For more information, you can refer to this following YouTube video (not mine).


Access WordPress files on Google Cloud

Situation 1: You just want to delete a plugin

You might run into a situation such that you added a plugin and the whole WordPress crashes. (I do not know if you can safely delete a theme if that is what your problem is. Please consult a professional if your problem is related to a whole theme.)

That is, due to some mistake in the added plugin, you cann’t even login the WordPress wp-admin. The quickest way to solve the problem actually is to right click the SSH on Google Cloud instance and then click the Open in browser window.

Access WordPress files on Google Cloud - Open in browser window on Google Cloud (SSN) to delete WordPress files via commands - part 1

You then see something like the screen below. If it is a plugin and you do not mind losing the plugin (e.g., you can download it again from public Internet easily), you can actually use a command to delete the plugin.

Access WordPress files on Google Cloud - Open in browser window on Google Cloud (SSN) to delete WordPress files via commands - part 2

The command looks like below. Make sure that the command address is correct (you do not want to delete something you do not intend to delete) and it is okay for you to lose this plugin totally.

Situation 2: You want to check WordPress files when you can not check them via WordPress wp-admin portal

Note that, if you can access WordPress wp-admin portal and you set up the plugin of WP file manger, you can access WordPress files at the wp-admin portal interface. However, if your WordPress crashes, and you can not even login the wp-admin portal, the solution is to use a FTP interface.

  1. Download Google Cloud SDK. The link: https://cloud.google.com/sdk/docs/install After setting it up, it will link to your Google account and verify your identity. It is pretty automatic actually.
    Access WordPress files on Google Cloud - Download Google Cloud SDK
    After setting up the software, you will see teh following interface:
    Access WordPress files on Google Cloud - Google Cloud SDK Shell interface
  2. Get gcloud command line from the SSH option of “View gcloud command.”
    Access WordPress files on Google Cloud - View gcloud command via SSH on Google Cloud
  3. Copy the text shown in the gcloud command line and paste back to the Google Cloud SDK Shell (i.e., the window shown in Step 1).
    Access WordPress files on Google Cloud - gcloud command line
    The Google Cloud SDK Shell will show the following when it is done.
    Access WordPress files on Google Cloud - Apply gcloud command line on Google Cloud SDK Shell
    After it completes, the following window will pop up.
    Access WordPress files on Google Cloud - Completion of generating SSH files
  4. It will save 3 files in C disk (if you are using Windows) -> Users -> Your user name in Windows ->. ssh folder. We will use them in next steps.
    Access WordPress files on Google Cloud - 3 SSH files generated by Google Cloud SDK in local computer
  5. Download FileZilla (it is free!) and click Edit -> Settings -> SFTP -> Add key file -> Choose: google_compute_engine.ppk (see the highlighted one). Click Open.
    Access WordPress files on Google Cloud - Add Google_compute_engine.ppk into FileZilla
  6. Use a text reader such as Notebook on Windows to open the third file (the one ends with .pub, see the hightlighted one shown below) and then copy the key to Google create a new SSH key item in Google. Then, click ADD ITEM, and then click SAVE.
    Access WordPress files on Google Cloud - Add Google_compute_engine.pub into Google Cloud SSH
  7. Type sftp:// your external IP address from Google instance engine into Host on FileZilla. Then, the username appear in front of the SSH Key that you just pasted on Google SSH Key window. Finally, if you are using bitnami WordPress, you should be able to find the password on Google engine webpage. (As you can see, the logic of Username and Passowrd is the same as the last section where we try to link to phpMyAdmin.) Click Quickconnect and you should be able to see WordPress files on FileZilla.
    Access WordPress files on Google Cloud - Add host IP, User name, and Password into FileZilla

For more information, you can refer to this following YouTube video (not mine).

Leave a Comment