By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,823 Members | 730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,823 IT Pros & Developers. It's quick & easy.

Cannot connect to MySQL DB remotely

P: n/a
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.j ava:1704)
at com.mysql.jdbc.Connection.(Connection.java:491)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.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
May 3 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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...transaction%22

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

Regards,
Bill K.
May 3 '06 #2

P: n/a
Ike

"Bill Karwin" <bi**@karwin.com> wrote in message
news:e3*********@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...ure+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
May 3 '06 #3

P: n/a
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
May 4 '06 #4

P: n/a
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/...roperties.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.
May 4 '06 #5

P: n/a
Ike

"Bill Karwin" <bi**@karwin.com> wrote in message
news:e3********@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/...roperties.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
May 5 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.