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.