Bug #18486 Cannot connect to database with name longer than 8 characters
Submitted: 24 Mar 2006 14:40 Modified: 29 Mar 2006 21:02
Reporter: Eric Fontaine Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.0.19 OS:Solaris (Solaris)
Assigned to: CPU Architecture:Any

[24 Mar 2006 14:40] Eric Fontaine
Description:
I Am using MySQL version: mysql-standard-5.0.19-solaris8-sparc.

I am experiencing the exact same problem as described in:
bug #3022 which is supposedly fixed: see link:
http://bugs.mysql.com/bug.php?id=3022

How to repeat:
	String host = "zcars0zh";
	String port= "3306";
	String database = "crashTool";
	String user = "root";
	String password = "eric1";		
    	Class.forName("com.mysql.jdbc.Driver").newInstance();
	Connection Conn =
		java.sql.DriverManager.getConnection("jdbc:mysql://"+host+":"+port+"/"+database,	
		user,password);
	
The above connection attempt will fail. It tries to connect to database "crashTool" (9 characters).

I have a duplicate database called "crshTool" (8 characters). A connection to this database
works fine.
[24 Mar 2006 16:50] Valeriy Kravchuk
Thank you for a problem report. Please, specify the exact version of Connector/J used.
[24 Mar 2006 18:04] Eric Fontaine
Thanks for your quick response.

Your suspicion is correct I am using some really old JDBC code:
I ported code from server that was setup in 2003 to a server
that I am setting up now. I don't know the exact version of
JDBC but it was installed on Dec 8/2003. So it is obviously 
the wrong version to be using. I suspected doing a blind copy
of this would haunt me.

Sorry about wasting your time,
But Thanks for your help.

I will try to find the latest version of JDBC code and download and install
it.

If you know of a web link to direct me to more information on this
I would appreciate it.
I am Using apache-tomcat-5.5.15.
Thanks,
Eric.

Old server code (dated Dec 8/2003):
wcary3ue-270> pwd
/usr/webServer/servlets/swerrTool/com/mysql/jdbc
wcary3ue-271> lt
total 862
drwxr-x---   2 verifwww cdncv        512 Dec  8  2003 xa/
drwxr-x---   3 verifwww cdncv        512 Dec  8  2003 jdbc2/
drwxr-x---   2 verifwww cdncv        512 Dec  8  2003 jdbc1/
drwxr-x---   3 verifwww cdncv        512 Dec  8  2003 ../
drwxr-x---   2 verifwww cdncv        512 Dec  8  2003 util/
drwxr-x---   6 verifwww cdncv       2048 Dec  8  2003 ./
-rwxr-----   1 verifwww cdncv       1027 Dec  8  2003 RowData.class
-rwxr-----   1 verifwww cdncv        792 Dec  8  2003 WatchableOutputStream.class
-rwxr-----   1 verifwww cdncv       5320 Dec  8  2003 ResultSetMetaData.class
-rwxr-----   1 verifwww cdncv        826 Dec  8  2003 AssertionFailedException.class
.
.
.
-rwxr-----   1 verifwww cdncv        665 Dec  8  2003 Driver.class
-rwxr-----   1 verifwww cdncv       3116 Dec  8  2003 Debug.class
-rwxr-----   1 verifwww cdncv      62296 Dec  8  2003 DatabaseMetaData.class
-rwxr-----   1 verifwww cdncv      35450 Dec  8  2003 Connection.class
-rwxr-----   1 verifwww cdncv      20367 Dec  8  2003 Connection$UltraDevWorkAround.class
etc.
[28 Mar 2006 22:34] Mark Matthews
I've just tested this with the latest Connector/J (3.1 and 5.0) with a database named "thisDatabaseIsLongerThanEightChars" and it works.

Please test with the latest version once you've installed it and things should work for you.
[29 Mar 2006 21:02] Eric Fontaine
It works now with the latest JDBC Connector code.

Here's how I installed it.
I Downloaded the latest drivers (mysql-connector-java-3.1.12.tar.gz) from
http://dev.mysql.com/downloads/connector/j/3.1.html
I Installed the mysql-connector-java-3.1.12.tar.gz under /usr/local/mysql-connector-java-3.1.12
I Copied the JDBC connection jar file over to the servlet lib directory
cp /usr/local/mysql-connector-java-3.1.12/mysql-connector-java-3.1.12-bin.jar /usr/local/apache-tomcat-5.5.15/webapps/csi_crash_tool_dev/WEB-INF/lib/mysql-connector-java-3.1.12-bin.jar
The servlet automatically finds this jar file to use for MySQL connections