Connect to CloudSQL from Ads Script

72 views
Skip to first unread message

Robert Lill

unread,
Dec 4, 2019, 3:02:19 PM12/4/19
to AdWords API and Google Ads API Forum
Hi,

I want to connect to CloudSQL from my Ads Script. I can do this with the generic Jdbc method
Jdbc.getConnection(url, user, password);
but it fails with the recommended method
Jdbc.getCloudSqlConnection(url, user, password);

Failed to establish a database connection. Check connection string, username and password.

I checked them. Several times.
URL for getConnection(): 'jdbc:mysql://123.123.123.123/database'
URL for getCloudSqlConnection(): 'jdbc:google:mysql://project:europe-west1:instance/database'

Disadvantages of the generic method are
- Need to put external IP-Address in connection string.
- Need to whitelist Ads Script server IP in Cloud SQL.
IPs may change and break the functionality of my script.

Has anyone succeeded in connecting to Cloud SQL with getCloudSqlConnection() ? Can you tell me what I need to change?

Thanks
Robert

Robert Lill

unread,
Dec 5, 2019, 2:45:37 AM12/5/19
to AdWords API and Google Ads API Forum
Just found out that there is a group that is a better place for my question, so I reposted it there:

Google Ads API Forum Advisor Prod

unread,
Dec 5, 2019, 9:30:19 AM12/5/19
to rober...@tiekinetix.com, adwor...@googlegroups.com

Hi Robert,

Glad you were able to resolve your issue. Feel free to reach out to our team for any Google Ads API related questions.
 

Regards,
Anthony
Google Ads API Team



ref:_00D1U1174p._5001UODrUa:ref
Reply all
Reply to author
Forward
0 new messages