Search code examples
mysqlgoogle-app-enginegoogle-cloud-sql

ERROR 1045 (28000) access denied cloudSQL


ERROR 1045 (28000): Access denied for user 'machines'@'1xx.1xx.1xx.1xx' (using password: YES)

I ran this code in the command line

mysql --host=1xx.1xx.1xx.1xx --user=machines --password

where the host IP address is obtained by requesting IPv4 address from cloudSQL. I've tried running the same code but changing the --host parameter to IPv6 address provided, the result is still the same.

I've added both my IPv4 and IPv6 address to the authorize network already. The tutorial provided at this link doesn't work for me: https://cloud.google.com/sql/docs/mysql-client


Solution

  • I've figure out the issue. At the user tab under access control. the host should be left as '%' instead of 'localhost' or anything else. Logging should be fine after that.