Home  >  Q&A  >  body text

Unable to connect to mysql on GCP Compute Engine

<p>I have installed mysql on a virtual machine in gcp using the following command: https://cloud.google.com/architecture/setup-mysql (I installed it manually on the virtual machine)</p> <p>But I can't connect to it using DBeaver. I'm using the external IP provided in the dashboard and I've allowed 3306, but even then I can't connect to it. I keep getting connection refused: 4003 error</p>
P粉312195700P粉312195700416 days ago550

reply all(1)I'll reply

  • P粉265724930

    P粉2657249302023-09-01 10:18:46

    Connection refused: 4003 error

    This means that the instance is not listening on the port you are trying to connect to or the firewall is down. In order to fix this error, we need to ensure that the listening process on the virtual machine is running and listening on the correct port. We then verify that Google Cloud Firewall is configured correctly and turned on

    You should look for default-allow-ssh to see if your firewall rules allow SSH connections. If firewall and IAP don't solve your problem.

    Check if you have access rights. When you add a user and grant permissions to them (or an existing user), you need to specify the hosts or network ranges that the user is allowed to connect to. Follow the steps in this Stack Question and check if you can connect now.

    For more information, follow How to Allow Remote Connections to MySQL. Attached SSH troubleshooting documentation.

    reply
    0
  • Cancelreply