This is a duplicate of #2177.
The error is caused by changes needed to support MySQL-4.1, which were made when
the charsets functionality in MySQL-4.1 was still in flux.
You will need to download the latest nightly snapshot of Connector/J 3.1 from
http://downloads.mysql.com/snapshots.php to see the fix, or wait for the release
of Connector/J 3.1.2.