0

I'm trying to connect from my Google Cloud Compute VM to my Google Cloud MySQL instance through its private IP. Both are in the same VPC, and it appears the MySQL instance is actually reached, but denies access with the error:

ERROR 1045 (28000): Access denied for user 'user'@'ip-address' (using password: YES)

I'm 100% sure I'm using the right username and password. If I try to connect from the same VM to the same MySQL server, with the same credentials over public IP (using SSL), it works just fine.

The user I'm trying to connect with also has its host set to wildcard (so it's 'user'@'%'). It has all privileges on the database I want to use (though the access is denied before indicating which table to use, so I'm not sure if this is relevant). The output of SHOW GRANTS for user; is:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'user'@'%' WITH GRANT OPTION

GRANT ALL PRIVILEGES ON `database`.* TO 'user'@'%'

The Google documentation only advises checking your credentials, which I did verify, so I'm hoping anyone here can provide an answer.

Wouter Florijn
  • 2,711
  • 2
  • 23
  • 38

1 Answers1

1

It appears that enforcing TLS also affects the private IP connection. To me, this wasn't clear from the documentation, and the errors I received don't provide much insight either. Therefore, I tried connecting using the private IP without the client key/certificate, while I did use them for the public IP.

I solved the issue by using the same client certificates for the connection over private IP.

Another thing to note is that disabling TLS enforcement doesn't solve the issue. With my setup, it appears disabling TLS isn't an option, even though the interface says it's disabled. I'm not sure why that's the case.

Wouter Florijn
  • 2,711
  • 2
  • 23
  • 38