Trouble connecting to MySql from Google App Script using JDBC

261 views
Skip to first unread message

Michael Harapiak

unread,
Oct 17, 2023, 5:41:15 PM10/17/23
to NodeChef
Hi, 
I'm having trouble connecting to my Nodechef Mysql database from Google App Script using Google's JDBC connector.

I've tried my username, root, the provided connection string, breaking the string up and passing the username and password separately, using the server IP instead of the name, but no luck.

The style of connection string I'm using is
url ="jdbc:mysql://[username]:[password]@[server]:[port]/[dbname]"

With app script:
var conn = Jdbc.getConnection(url);

I get this failure every time:

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

I know that the credentials work, because I use them to connect to the database with other tools.

In the database log I can see it unable to resolve the names of Google IP addresses so it seems that the first step of the connection is working.
Am I missing something?

Thanks

Michael Harapiak

unread,
Oct 20, 2023, 2:35:27 PM10/20/23
to NodeChef
Found the answer on Reddit 

SSL is turned on by default for App Script JDBC.
You need to add "?useSSL=false" to the connection string.
Reply all
Reply to author
Forward
0 new messages