4 messages in com.mysql.lists.javaRe: Serious trouble using MySQL 4.1.1...| From | Sent On | Attachments |
|---|---|---|
| Mikael Björn | 12 Apr 2004 10:57 | |
| Rikard Froberg | 13 Apr 2004 04:26 | |
| Mikael Björn | 13 Apr 2004 04:39 | |
| Mark Matthews | 13 Apr 2004 10:03 |
| Subject: | Re: Serious trouble using MySQL 4.1.1 and Connector/J 3.1 (or 3.0.11) or "Not a java.sql.SQLException: Communication link failure... again"![]() |
|---|---|
| From: | Mark Matthews (ma...@mysql.com) |
| Date: | 04/13/2004 10:03:19 AM |
| List: | com.mysql.lists.java |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Mikael Björn wrote:
Hi,dear Gurus! I'm having serious troubles connecting from a Windows XP machine (and yes, the FW is down) and a MySQL 4.1.1 database using MYSQL Connector/J 3.1 (3.0.11 and 3.1 Nightly build aswell) running on a Redhat Linux 9 box.
It all started when I upgraded the DB server from 3.23 to a 4.1.1 server (Compiled from source). Suddenly the ODBC connector 3.51 stopped working and after some digging I discovered the "--old-passwords" option to mysqld. ODBC started working again and I moved on to more interesting stuff... getting my development up and running.
KAABLAAAM!!! Suddenly I couldn't connect at all from my Java applications. All connections resulted in an error and a stack trace...whatever I tried to do. So I disabled the "--old-password" option again...
The packet trace from a failed connection:
-
----------------------------------------------------------------------------
------- C:\System\se\test>java -cp "C:\jar\mysql-connector-java-3.1.1-alpha-bin.jar;." jdbctest Exception at: jdbctest.main SQLState: 08S01 Message: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream
** BEGIN NESTED EXCEPTION **
java.io.IOException MESSAGE: Unexpected end of input stream
STACKTRACE:
java.io.IOException: Unexpected end of input stream at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1096) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:626) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562) at com.mysql.jdbc.Connection.<init>(Connection.java:491) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at jdbctest.main(jdbctest.java:12)
** END NESTED EXCEPTION **
Vendor: 0
C:\System\se\test>
-
----------------------------------------------------------------------------
-------
Then I pulled out my trustworthy Ethereal network sniffer to examine the packets sent between the server and the client.
And here I saw some strange behavior: (Packet trace follows)
------------------------------------------------------------ No. Time Source Destination Protocol Info 211 8.278942 www.server.com www.client.com MySQL Server Greeting Protocol : 10 ,version: 4.1.1-alpha-log Caps: 0xffffa22c 212 8.290853 www.client.com www.server.com MySQL Login Request Caps: 0xffffc087 ,user: ÿÿ ,password: test 214 8.291008 www.server.com www.client.com MySQL Response Error Code: 413
------------------------------------------------------------
The funny thing is in the user part of the login request packet... Whatever I write in the getConnection I get this behaviour and this is the call resulting in the above packet exchange:
------------------------------------------------------------ Connection conn =
DriverManager.getConnection("jdbc:mysql://www.server.com/test","test","test"
);
------------------------------------------------------------ The really strange thing is that it worked until I upgraded the server...
So now I'm out of options... anyone got any ideas on how to get this up and running. (The really strange thing is that it all works if I run the Java code on the server)
My current setup: Server: 1. Redhat Linux 9 (with the FW disabled) 2. MySQL Server 4.1.1 built from sources 3. java version "1.4.1_02" 4. MySQL Connector/J 3.1 (3.0.10 or 3.1.1 20040412)
3.0.10 doesn't know about the 4.1.1 auth protocol, but 3.1.1 should work fine (it's actually tested against the latest 4.1.1 on every check-in and every evening).
You might double check that you are _actually_ running Connector/J 3.1.1, as many people that have reported errors similar to this actually have an older version of Connector/J sitting around somewhere in their CLASSPATH (jre/lib/ext, application server common libraries, CLASSPATH entries, etc, etc).
An easy way to check would be to see what Connection.getMetaData().getDriverVersion() returns...If you are really using a recent nightly build of 3.1.x, you should get something along the lines of:
"3.1.2 ( $Date: 2004/02/21 17:43:42 $, $Revision: 1.27.4.31 $ )";
Regards,
-Mark - -- Mr. Mark Matthews MySQL AB, Software Development Manager, J2EE and Windows Platforms Office: +1 708 332 0507 www.mysql.com
Meet the MySQL Team! April 14-16, 2004 http://www.mysql.com/uc2004/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAfB1ttvXNTca6JD8RAlbcAKCeAvDot6Uew+lY8gnSAJnmHm4JRgCfd671 97dTvi9Z9pCWoCC/8z7HwNU= =2wFN -----END PGP SIGNATURE-----




