Bug #1854 Database name truncated to 4 chars with JDBC client
Submitted: 16 Nov 2003 22:48 Modified: 17 Nov 2003 5:47
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:4.1.0-alpha OS:Windows (Win2K)
Assigned to: Mark Matthews CPU Architecture:Any

[16 Nov 2003 22:48] [ name withheld ]
Description:
Using MySQL Connector/J 3.1.0-alpha to connect to MySQL 4.1.0-alpha, error "access denied to database" is obtained when attempting to login under non-root account and where the database name is more than 4 characters. See also : http://www.jroller.com/page/lowem/20031116#screwy_setup_mysql_4_1

How to repeat:
1. Download and install MySQL 4.1.0-alpha.

2. Download and install MySQL Connector/J 3.1.0-alpha.

3. Create a couple of test databases, mytest, mydb, etc.

4. Create arbitrary user account and do a grant all on mytest.* to user, same for mydb.

5. Use DriverManager.getConnection() to test out the connection.

6. Access to database "myte" is denied error with "mytest", but database "mydb" works.

Suggested fix:
Works under 4.0.16 (production) release, with both 3.0.9 and 3.1.0-alpha JDBC drivers. This problem is encountered only with 4.1.0-alpha.
[17 Nov 2003 5:47] Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

This has been fixed for quite some time in the source tree. Please try a nightly snapshot from http://downloads.mysql.com/snapshots.php