0

I am attempting to connect to a hosted (not local) MySQL database using the Jdbc.getConnection method in Google apps script, but I'm repeatedly getting "failed to connect, check user name, password, etc" error messages when I attempt to test the connection.

I have whitelisted the Google apps script IP ranges in my Cpanel Remote MySQL settings, and I have even temporarily setup a wildcard "%" access host to allow everything, but cannot get the connection to work.

I can successfully connect to the database from my desktop PC using SQLyog from my desktop PC, so the server, database name, user, password, port, etc values are all correct, and I'm using these exactly as specified in the getConnection documentation.

I've tested the connection many times while experimenting with the connection values and whitelist rules, and the final twist is that on one solitary occasion, I connected successfully! However, all previous and all subsequent attempts have consistently failed.

Can anyone shed any light on what the problem could be, or suggest avenues for further investigation? The solitary successful call made me suspect that this is a whitelisting issue, and I just got lucky and got one call routed via a Google IP that my host finds acceptable. However, this doesn't square with the continued failure even when I use the simple % wildcard to allow anything.

I'm stumped!

closed as off-topic by jonsca Jul 1 at 2:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "It is a question about creating/developing a web application." – jonsca
If this question can be reworded to fit the rules in the help center, please edit the question.

migrated from superuser.com Apr 7 at 8:43

This question came from our site for computer enthusiasts and power users.