title: Error Connecting to Cloud SQL With Google Apps Script
body: <p>I'm trying to create a basic connection to my Cloud SQL database in Google Apps Script using the code:</p>
  
  <pre><code>function myFunction()
  {
      var conn = Jdbc.getCloudSqlConnection("jdbc:google:rdbms://instance_IP/DB_name");
  }
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Failed to establish a database connection. Check connection string, username and password
  </code></pre>
  
  <p>I know that there is the option of including username and password parameters to the command. Information in this link <a href="https://developers.google.com/apps-script/reference/jdbc/jdbc#getCloudSqlConnection(String,String,String)" rel="nofollow noreferrer">https://developers.google.com/apps-script/reference/jdbc/jdbc#getCloudSqlConnection(String,String,String)</a>.</p>
  
  <pre><code>function myFunction()
  {
      var conn = Jdbc.getCloudSqlConnection("jdbc:google:rdbms://instance_IP/DB_name", "userName", "password");
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>I'm not sure if there is something that I am missing.</p>