Can't SSH to Google Cloud VM after installing MySQL


Josh Greenlaw

I'm trying to setup a small blog server on Google Cloud Platform using a free f1.micro instance. I'm using Ubuntu 20.04 LTS as the base image (Ubuntu is the only Linux distribution I'm completely familiar with), although I tried 20.10. Everything worked fine until I installed MySQL. Here is the guide I'm going to follow. After each failure, I deleted the VM and started over.

These are the VM settings:

Virtual machine settings

In addition to the steps listed in the guide, I also tried adding ssh to ufw, just in case.

sudo ufw allow ssh
sudo ufw enable

I also tried running this prior to installing MySQL, based on this article after failing the first couple of times.

sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade

Once I try installing mysql-server the ssh prompt hangs here:

ssh hang

I've tried reconnecting immediately and I've tried waiting overnight, but I always get stuck here when I try to connect again (it stays like this for a very long time before failing):

Can't reconnect

Jose Luis Delgadillo

I experienced a similar issue with a MySQL Instance in GCP, the first issue was related with the type of the VM instance I used, I had a f1-micro machine type on this VM Instance and suddenly I wasn’t able to access the ssh. As this type of VM Instance has only 0.6GB of memory, it became out of memory soon, I changed it to a e2-medium that is value by default and it resolved my problems this time. As the Instance was out of memory the services in the instance started to fail, it was the reason that I can't access my instance.

At another time I started again with similar issues, but this time, the problem was the disk, I only had 10 GB and there was a process filling my disk, when a partition was out of space, the instance started to fail again. I only resized my disk, now my instance disk is 20GB and is working fine.

Having said that, I suggest increasing your resources per your convenience to enhance your performance, because to have the problems you described is a good indicator that your existing machine type is not a good fit for your workloads you run on that instance.

So, I suggest to change the machine type to adjust your memory and you can follow the next steps for these tasks please visit the following link to get further information about it.

Changing a machine type

1.- Go to the VM Instances page.

2.- In the Name column, click your instance.

  1. From the instance details page, complete the following steps:

    a) Click the Stop button to stop the instance, if you have not stopped it yet.

    b) After the instance stops, click the Edit button at the top of the page.

    c) Under the Machine configuration section, select the machine type you want to use, or create a custom machine type to increase only the Memory.

    d) Save your changes and start again your VM Instance.

You can resize your disk following this guide or with the following command:

gcloud compute disks resize DISK_NAME --size DISK_SIZE

Or with the Console:

  1. Go to the Disks page to see a list of zonal persistent disks in your project.
  2. Click the name of the disk that you want to resize.
  3. On the disk details page, click Edit.
  4. In the Size field, enter the new size for your disk.
  5. Click Save to apply your changes to the disk.

After you resize the disk, you must resize the file system so that the operating system can access the additional space.

Note: Do not resize the boot disk beyond 2 TB as this is the limit.

Related


Can't SSH to Google Cloud VM after installing MySQL

Josh Greenlaw I'm trying to setup a small blog server on Google Cloud Platform using a free f1.micro instance. I'm using Ubuntu 20.04 LTS as the base image (Ubuntu is the only Linux distribution I'm completely familiar with), although I tried 20.10. Everything

Can't SSH to Google Cloud VM after installing MySQL

Josh Greenlaw I'm trying to setup a small blog server on Google Cloud Platform using a free f1.micro instance. I'm using Ubuntu 20.04 LTS as the base image (Ubuntu is the only Linux distribution I'm completely familiar with), although I tried 20.10. Everything

Can't SSH to Google Cloud VM after installing MySQL

Josh Greenlaw I'm trying to setup a small blog server on Google Cloud Platform using a free f1.micro instance. I'm using Ubuntu 20.04 LTS as the base image (Ubuntu is the only Linux distribution I'm completely familiar with), although I tried 20.10. Everything

Can't SSH to Google Cloud VM after installing MySQL

Josh Greenlaw I'm trying to setup a small blog server on Google Cloud Platform using a free f1.micro instance. I'm using Ubuntu 20.04 LTS as the base image (Ubuntu is the only Linux distribution I'm completely familiar with), although I tried 20.10. Everything

Google VM Instant - Can't access SSH

Jeff I have installed ERPNext from Google Click to Deploy since 6 months ago and with that software it worked until last week until I lost access to the system and SSH When connecting using SSH, the system shows that connecting through the Cloud Identity-Aware

Google VM Instant - Can't access SSH

Jeff I've installed ERPNext from Google Click to Deploy since 6 months ago and with that software it worked until last week until I lost access to the system and SSH When connecting using SSH, the system shows that connecting through the Cloud Identity-Aware p

Google VM Instant - Can't access SSH

Jeff I have installed ERPNext from Google Click to Deploy since 6 months ago and with that software it worked until last week until I lost access to the system and SSH When connecting using SSH, the system shows that connecting through the Cloud Identity-Aware

Google VM Instant - Can't access SSH

Jeff I've installed ERPNext from Google Click to Deploy since 6 months ago and with that software it worked until last week until I lost access to the system and SSH When connecting using SSH, the system shows that connecting through the Cloud Identity-Aware p

Can't SSH to VM

Ken I have a VM installed and some custom disk images (CentOS) at work, but I can't SSH into the VM. Here are some things I've tried: [VM]$ ssh root@localhost Password: Great, ssh is using loopback. But when I try from host: ~/VirtualBox VMs% ssh -v -v -v roo

Can't SSH to VM

Ken I have a VM installed and some custom disk images (CentOS) at work, but I can't SSH into the VM. Here are some things I've tried: [VM]$ ssh root@localhost Password: Great, ssh is using loopback. But when I try from host: ~/VirtualBox VMs% ssh -v -v -v roo

Can't seem to install Google Cloud Managed VM

Gabriel Kohen Following Google 's instructions for installing a managed virtual machine , everything seemed to be going well until I did this step: gcloud preview app setup-managed-vms The result is the following error: ERROR: (gcloud.preview.app) Invalid ch

Can't seem to install Google Cloud Managed VM

Gabriel Kohen Following Google 's instructions for installing a managed virtual machine , everything seemed to be going well until I did this step: gcloud preview app setup-managed-vms The result is the following error: ERROR: (gcloud.preview.app) Invalid ch

Can't seem to install Google Cloud Managed VM

Gabriel Kohen Following Google 's instructions for installing a managed VM , everything seemed to be going well until I did this step: gcloud preview app setup-managed-vms The result is the following error: ERROR: (gcloud.preview.app) Invalid choice: 'setup-

Can't seem to install Google Cloud Managed VM

Gabriel Kohen Following Google 's instructions for installing a managed VM , everything seemed to be going well until I did this step: gcloud preview app setup-managed-vms The result is the following error: ERROR: (gcloud.preview.app) Invalid choice: 'setup-

Can't SSH to Azure VM

Samas Agarwal I have an Ubuntu VM (resource group, not Classic VM) on Azure and it's all available. I recently tried to SSH into a VM using Putty, but I couldn't. I get the error: Network Error: Connection Timed out. I've made sure port 22 is open for SSH in t

Can't SSH to Azure VM

Samas Agarwal I have an Ubuntu VM (resource group, not Classic VM) on Azure and it's all available. I recently tried to SSH into a VM using Putty, but I couldn't. I get the error: Network Error: Connection Timed out. I've made sure port 22 is open for SSH in t

Can't SSH to Azure VM

Samas Agarwal I have an Ubuntu VM (resource group, not Classic VM) on Azure and it's all available. I recently tried to SSH into a VM using Putty, but I couldn't. I get the error: Network Error: Connection Timed out. I've made sure port 22 is open for SSH in t

Can't SSH to Azure VM

Samas Agarwal I have an Ubuntu VM (resource group, not Classic VM) on Azure and it's all available. I recently tried to SSH into a VM using Putty, but I couldn't. I get the error: Network Error: Connection Timed out. I've made sure port 22 is open for SSH in t

Can't SSH to Azure VM

Samas Agarwal I have an Ubuntu VM (resource group, not Classic VM) on Azure and it's all available. I recently tried to SSH into a VM using Putty, but I couldn't. I get the error: Network Error: Connection Timed out. I've made sure port 22 is open for SSH in t

Can't access MySQL database on Google Cloud

249 I am new to Google Cloud . I have deployed the lightbulb package in Google Cloud. I have a server address, ie: and when entering, I can log into my phpMyAdmin.150.200.100.10150.200.100.10/phpmyadmin Of course if I type 150.200.100.10/index.html I can see a

SSH [keys] to the VM using Google Cloud Functions

Mexican Is it possible to ssh into a local VM using Google Cloud Functions? Specifically, can I give Cloud Functions a private key to use? I'm thinking of running a timer job that will use a python script to get data from a virtual machine that is not in GCP.

Unable to connect to SSH on Google Cloud VM instance

porcelain snake I ran into an issue today where I couldn't SSH into a Google Cloud VM instance running debian-10-buster. SSH has been working until today, suddenly lost connection while docker is running. I've tried restarting the VM instance and resetting, bu

Can't open app after installing from Google Play

Marnana. John My app can't open it from Google Play, not even test from another device (same problem). Development Association I had the same problem getting started with Android Studio. It looks like you missed something in the app Manifets. , make sure you a

Can't open app after installing from Google Play

Marnana. John My app can't open it from Google Play, not even test from another device (same problem). Development Association I had the same problem getting started with Android Studio. It looks like you missed something in the app Manifets. , make sure you a

Can't see Google Maps after installing from APK

username When I install the android apk file, the google map is not visible, but when I run the same code from Eclipse, the map is visible. I have given all permissions in android manifest file. Here is my manifest file - <?xml version="1.0" encoding="utf-8"?>

Can't open app after installing from Google Play

Marnana. John My app can't open it from Google Play, not even test from another device (same problem). Development Association I had the same problem getting started with Android Studio. It looks like you missed something in the app Manifets. , make sure you a

Can't open app after installing from Google Play

Marnana. John My app can't open it from Google Play, not even test from another device (same problem). Development Association I had the same problem getting started with Android Studio. It looks like you missed something in the app Manifets. , make sure you a

Can't open app after installing from Google Play

Marnana. John My app can't open it from Google Play, not even test from another device (same problem). Development Association I had the same problem getting started with Android Studio. It looks like you missed something in the app Manifets. , make sure you a

Can't see Google Maps after installing from APK

username When I install the android apk file, the google map is not visible, but when I run the same code from Eclipse, the map is visible. I have given all permissions in android manifest file. Here is my manifest file - <?xml version="1.0" encoding="utf-8"?>