I'm trying to create a basic connection to my Cloud SQL database in Google Apps Script using the code:
function myFunction()
{
var conn = Jdbc.getCloudSqlConnection("jdbc:google:rdbms://instance_IP/DB_name");
}
I get the error:
Failed to establish a database connection. Check connection string, username and password
I know that there is the option of including username and password parameters to the command. Information in this link https://developers.google.com/apps-script/reference/jdbc/jdbc#getCloudSqlConnection(String,String,String).
function myFunction()
{
var conn = Jdbc.getCloudSqlConnection("jdbc:google:rdbms://instance_IP/DB_name", "userName", "password");
}
When I tried this method with my username and password, I got the same error as above. The username and password are mine for accessing the instance on Google Cloud Platform.
I'm not sure if there is something that I am missing.