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.