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

Cloud SQL database failed to connect from mysql client


I'm unable to connect to Google Cloud SQL from my desktop mysql client. I am also unable to set the sql instance password in google console. It says "instance is busy". I was able to connect to the sql instance using this same command line few weeks ago. Now it's unclear why it is not allowing the same. I see a similar question being asked before but it does not have any resolution.

c:\mysql --host=xxx.xxx.253.xx --user=root --password ERROR 1045 (28000): Access denied for user 'root'@'xxx.xxx.214.xxx' (using password: NO)

The reason I'm trying to connect from the command line is that my access to the same DB from GAE is also failing with the same error as below.

com.xxx store: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

This is the first time I'm trying to access the database from a GAE app. Any idea why the mysql client is not connecting and where I should look to troubleshoot?

Edit: mysql client connection issue is resolved by upgrading to a newer mysql version (5.6.19). The GAE connection issue persists.

The jdbc url I use is "jdbc:google:mysql://projid:sqlinstance/dbname?user=root&password=root"


Solution

  • The GAE connection issue was resolved by removing the password from the URL. The new jdbc url is "jdbc:google:mysql://projid:sqlinstance/dbname?user=root".