Hello, I had been connecting to a MySQL database stored on Google Cloud from my domain for some years without issue. Some days ago I moved my domain to another hosting and its IP changed. Now I can't connect to the DB (permission denied error).
More info and what I've tried so far:
I don't connect to a Cloud SQL instance, but apparently to a DB in a VM instance.
I can't find that DB in the instance.
I think I gave the correct permissions in the firewall.
I connect to the DB with the function mysqli_connect
I don't know what else I can try, any idea please?
Thank you!
Hello,
Does your application is managed by you or a third part provider. I ask this because you mention there is no clear information if the DB is running on Cloud SQL or a VM.
With that said, how did you verify the instance is not running on the VM ? (i.e with systemctl, mysqld etc...). Have you checked if the instance is perhaps running the VM as a docker service (you can try docker ps and see if there is a database running).
If possible would be great if you can share more details like how are you connecting, port, and if there is a firewall allowing access to that port, etc...
Hello, I'm sorry I didn't reply for a while.
I have no instances and so I can't connect via SSH and execute your commands, I don't know if there's another way to do it.
I used to connect to the DB from PHP like this:
$db = new mysqli('104.196.28.231','USER','PASSWORD','DB_NAME');
The IP is a Google Cloud IP.
Thank you