2

I am using xeround for a MySQL database and for the past year I've been connecting to it with Google Apps Script in a Google Docs Spreadsheet. Now all of a sudden it is not connecting. I've checked the username and password, and I've double checked the instance information. I contacted xeround to see if there was a problem with the MySQL database and they say everything is healthy. I'm able to connect with the database through phpMyAdmin using the same user name and password. Here is the code I have in my Google Docs Spreadsheet:

var connectionstring = "jdbc:mysql://instance276.db.xeround.com.:3859/pantalog";
var conn = Jdbc.getConnection(connectionstring, "xxxxxxxxxx", "xxxxxxxxx");
var stmt = conn.createStatement();

The error I get is "Failed to establish a database connection. Check connection string, username and password."

Has Google made some change to JDBC that I'm unaware of?

user1706788
  • 21
  • 1
  • 3
  • 1
    There is the dot character `.` after `.com` and before the colon character `:`. In theory there should not be it there. Also it would be more secure to eliminate the login and password, if they are real. – megabyte1024 Sep 28 '12 at 16:29

3 Answers3

1

First thing, there is a typo in that connection string, you shouldn't have that "." before the port number...

var connectionstring = "jdbc:mysql://instance276.db.xeround.com.:3859/pantalog";

should be

var connectionstring = "jdbc:mysql://instance276.db.xeround.com:3859/pantalog";

In case that was just a typo...

I have been having the same kind of problems lately, and think this is actually a DNS problem! (yes I know that sounds like it is impossible).

I get the same error using the DNS entry for my MySQL server.

I then do a nslookup using google's DNS servers (8.8.8.8) and take that IP address, and use it in the connection string instead...

That DNS name resolves to 107.22.255.231

Then it works

Bizarre, I know, but give it a try.

Also, I hope that is not your real username and password in the post :)

Manikandan C
  • 668
  • 1
  • 9
  • 22
mgmonteleone
  • 400
  • 1
  • 9
0

This solution worked for me. Substitute the hostname with the IP in the connection string fixes the issue. Seems the resolver in the JDBC is broken.

Rob
  • 21
  • 2
0

I found JDBC in Google Sheets to be quite buggy, so I built SeekWell which lets you automatically send data from MySQL to Sheets and can also sync changes from Sheets back to a database. You can schedule refreshes daily, hourly or every five minutes.

Disclaimer: I built this.