Google Spreadsheet cant connect to Remote MySql

Hello to all,

I'm having trouble connecting a Google Spreadsheet to a local MySql database in one of our offices.
Error displayed by Google is: A connection could not be established with the database, check user password and connection string.

This is the code i'm trying:

   var connectionstring = "jdbc:mysql://public_ip:9002/db_name";
   var conn = Jdbc.getConnection(connectionstring, "user", "password");
   var stmt = conn.createStatement();

Other scenario considerations:
1. The Firewalls incoming 9002 port is being forwarded correctly into the 3306 on the local db server.
2. user and password work fine since Remote Workbench connections are possible.
3. I've even tied up a remote MS Excel sheet to the db and it works with the same url and login information
4. No IP incomming connections are being blocked explicitly, you can call the port from whatever ip you want and you will be redirected to the internal server

Does somebody have any guidance on what to try?
i've been fighting for over a week!

Thanks to all
Eric.
Eric StollAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
The message...

A connection could not be established with the database, check user password and connection string.

Is clear.

First make sure you actually do have the correct user/pass.

You'll do this by connecting to your database instance using you IP (which might be localhost) + port 9002 + your user/pass.

If you can't connect via the mysql client, you'll never be able to connect using any other code.
0
Eric StollAuthor Commented:
David, thanks for your answer...

Finally the issue was with our Networking team. I was able to connect with Workbench and even Excel Sheets from my pc due to the fact that my current office ip was whitelisted on the remote firewall. My mistake was taking for granted his words: "no ips are blocked".

After a week of grappling with this I asked him again and finally adding googles ranges to the firewall did the trick.

Im still angry at the guy.

Thanks for your help!
rgds
Eric.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Google

From novice to tech pro — start learning today.