Bug #838 all JDBC connections fail
Submitted: 13 Jul 2003 13:10 Modified: 14 Jul 2003 6:33
Reporter: Ronald Jeremy Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:4.1.1-alpha OS:Linux (redhat linux 8)
Assigned to: Mark Matthews CPU Architecture:Any

[13 Jul 2003 13:10] Ronald Jeremy
Description:
After compiling and installing mysql 4.1.1-alpha from source, all JDBC connections fail with "Unexpected end of input stream" using connector-java 3.0.7-stable, 3.0.8-stable, and 3.1.0-alpha.  Finally I tried an old version of the mm driver (mm.mysql-2.0.13-bin.jar) and the connections work!  This makes me suspect something is wrong with the JDBC driver rather than mysql itself, as mysql never crashes or complains.  Here is a snippet from the connction failing:

** 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:339)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:782)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1585)
        at com.mysql.jdbc.Connection.<init>(Connection.java:524)
        at com.mysql.jdbc.Driver.connect(Driver.java:359)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:193)
        at UpdateBOAddresses.main(UpdateBOAddresses.java:20)

How to repeat:
compile and install latest source of mysql 4.1.1-alpha
try making a jdbc connection with connector-java 3.0.7-stable, 3.0.8-stable, or 3.1.0-alpha
[14 Jul 2003 6:33] Mark Matthews
MySQL-4.1.1 is not a _released_ version of MySQL...Notice that the age of both 3.0.8 and 3.1.0 (which both support 4.1.x) is _older_ than your build of MySQL-4.1. MySQL-4.1.1 is _alpha_ code and has _many_ changes in the protocol that Connector/J released versions don't know about (they couldn't as they were released before the changes were made). 

If you want to work with BK builds of MySQL, you will need to use a nightly snapshot of Connector/J (from http://mmmysql.sourceforge.net/snapshots/) to access anything newer than MySQL-4.1.0 (the released version).

Regards,

	-Mark
[27 Nov 2003 6:42] [ name withheld ]
I'm have the same problem, BUT I'm using mysql server 4.1.0-alpha and mysql-connector-java 3.0.9-stable. However, it is possible to connect with the same application and same JDBC driver to a mysql 4.0.12 database server...
That make me think that the problem is in mysql server > 4.1.0

I have also tried this with mysql-connector-java-3.1.0-alpha.

Please also refer to this discussion where Mr. Mark Matthews at MySQL AB replies that 4.1.0 has some buggy auth code:
http://dbforums.com/arch/174/2003/8/897454
[27 Nov 2003 6:52] [ name withheld ]
Hmm, I just now tested it with mysql-connector-java-3.1-nightly-20031127 (db=4.1.0-alpha) and got the same result again. My OS is RedHat 7.2 if that matters. (A friend of mine claims that it works fine on windows - I havent tested.)
[27 Nov 2003 7:25] [ name withheld ]
Now I tested it on my own windows-box and that worked fine!
Then I made a fresh installation of mysql 4.1.0-alpha on another linux-box (redhat 7.3) which also worked fine. I must say that it is probably my installation of mysql that is not doing very well (alternatively redhat 7.2).
Sorry for bugging you busy guys whit this nonsense ;-(