473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cannot connect to MySQL DB remotely

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
5 3821
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try...
3
by: Steven | last post by:
Hi All, I've installed MySQL 4.1.12 on my server, I can connect from the local machine with navicat, but not from a remote machine. I checked with 'nedstat' and there is something listening on...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
6
by: AP | last post by:
I have not seen any good examples on how to connect to a mySQL db. My website uses phpMyAdmin to administer the SQL databases. What confuses me is where are the databases that I create located? For...
3
by: pc | last post by:
hi everyone, I am trying to connect to a new mysql installation. I have given root permission to connect to all databases from anywhere; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY...
5
by: smatta | last post by:
I have just installed MySql version 5.0-18 on Red Hat Fedora Core 4. It is running but I cant connect to it using MySql Query Browser running on my pc. >From my pc, I can telnet to the sql...
2
by: zMisc | last post by:
I am using VB.NET 1.1 and cannot connect to a MySQL (v5) database. I've done the following: 1) Create a DSN for MyODBC. 2) Connect using: Driver=MySQL ODBC 3.51 Driver; Server=localhost; Data...
2
by: idorjee | last post by:
hi, can anyone tell me what am i doing wrong here. i'm trying to connect remotely to the MySQL database on a server (SunOS multivac 5.9 sparc SUNW,Sun-Fire-V240). i know that the username and the...
3
by: emsik1001 | last post by:
Hi http://dev.mysql.com/doc/query-browser/en/mysql-query-browser-connection.html I'm trying to connect from my Windows based PC to a dedicated server which is running on Linux system. I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.