Cannot connect to MySQL DB remotely

Cannot connect to MySQL DB remotely

am 03.05.2006 16:15:47 von Ike

Through Java, I am attempting to connect to a MySQL 4.12 server on a remote
computer. I can connect fine via php. I cann connect fine via Java, through
a servlet, when the servlet is on the same machine (localhost) as the MySQL
DB.

However, when they are on different machines with different IPs, calling
across the Internet (and there are no firewall issues -- I can connect fine
to the remote MySQL DB via php from the same machine, not are there
connection issues, it is the same db name, password and username, just a
different IP) the MySQL driver is choking on me with the following stack
trace: (btw max_connections in the MySQL DB is set to 100)

java.sql.SQLException: Server connection failure during transaction.
Attempted reconnect 3 times. Giving up. at
com.mysql.jdbc.Connection.createNewIO(Connection.java:1704)
at com.mysql.jdbc.Connection.(Connection.java:491)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDr iver.java:346)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)

Does anyone have any idea why this would be happening? Ive been looking at
this for days and cannot gain any insight into my problem here. TIA, Ike

Re: Cannot connect to MySQL DB remotely

am 03.05.2006 19:32:33 von Bill Karwin

Ike wrote:
> java.sql.SQLException: Server connection failure during transaction.

What version of the MySQL JDBC driver are you using? Be sure to check
for extra copies of the mysql jar, lurking in jre/lib/ext and places
like that.

Also for future reference, my favorite diagnostic search is googling for
the error message:

http://www.google.com/search?q=mysql+%22Server+connection+fa ilure+during+transaction%22

This turns up many hits, with various solutions for the error.

Regards,
Bill K.

Re: Cannot connect to MySQL DB remotely

am 04.05.2006 01:42:15 von Ike

"Bill Karwin" wrote in message
news:e3apfg029pu@enews4.newsguy.com...
> Ike wrote:
> > java.sql.SQLException: Server connection failure during transaction.
>
> What version of the MySQL JDBC driver are you using? Be sure to check
> for extra copies of the mysql jar, lurking in jre/lib/ext and places
> like that.
>
> Also for future reference, my favorite diagnostic search is googling for
> the error message:
>
>
http://www.google.com/search?q=mysql+%22Server+connection+fa ilure+during+tra
nsaction%22
>
> This turns up many hits, with various solutions for the error.
>
> Regards,
> Bill K.

Hi Bill,

I am using mysql-connector-java-3.1.7-bin.jar to connect to MySQL
4.1.12a-nt -- using the same Jar and MySQL versions for both cases (in the
one case, where the connection succeeds, and both are on the local machine,
and the failure one, where the DB is on a remote machine, but I can connect
via php from the same machine as the mysql-connector-java-3.1.7-bin.jar, but
NOT with mysql-connector-java-3.1.7-bin.jar)

Thanks, Ike

Re: Cannot connect to MySQL DB remotely

am 04.05.2006 21:07:39 von Ike

If I am trying to connect to, say http://64.233.244.105 I would specify my
connection url then as:

mysql://64.233.244.105:3306/mydatabasename

yes?
TIA, Ike

Re: Cannot connect to MySQL DB remotely

am 04.05.2006 21:48:30 von Bill Karwin

Ike wrote:
> If I am trying to connect to, say http://64.233.244.105 I would specify my
> connection url then as:
>
> mysql://64.233.244.105:3306/mydatabasename

That should be "jdbc:mysql://64.233.244.105:3306/mydatabasename".

See http://dev.mysql.com/doc/refman/5.0/en/cj-configuration-prop erties.html

Have you read any of the hits from the google search I referenced?
There seem to be a variety of possible causes for the "Server connection
failure during transaction" error.

Regards,
Bill K.

Re: Cannot connect to MySQL DB remotely

am 06.05.2006 01:21:24 von Ike

"Bill Karwin" wrote in message
news:e3dlqd0o42@enews1.newsguy.com...
> Ike wrote:
> > If I am trying to connect to, say http://64.233.244.105 I would specify
my
> > connection url then as:
> >
> > mysql://64.233.244.105:3306/mydatabasename
>
> That should be "jdbc:mysql://64.233.244.105:3306/mydatabasename".
>
> See
http://dev.mysql.com/doc/refman/5.0/en/cj-configuration-prop erties.html
>
> Have you read any of the hits from the google search I referenced?
> There seem to be a variety of possible causes for the "Server connection
> failure during transaction" error.
>
> Regards,
> Bill K.

Thanks Bill -- sorry, my URL WAS correct, but I copy-pasted it to my post
incorrectly(!). Yes, I DID see the link you sent, and, tracked down every
single issue without success EXCEPT the issue that the connector version I
am using may be unable to connect to a remote DB (3.0.17). I am going to try
it with 3.0.8 later tonite. Thanks for your help!-Ike