title: mysql jdbc apply exceeding username max length (16 char)
body: <p>I have a system that mostly written in java. This system has a simple MySQL user permission administrator. But now we getting started to work with more users and the length for the username is now over 16 chars. I modified all username length property in all mysql system tables. In Webmin and PhPMyAdmin modifying the password and table &lt;=> user relations works correctly. But in this java program all operation witch associated with long usernames will be stopped with throwned SQLException with message: String ' ...long username...' is too long for user name (should be no longer than 16).</p>
  
  <p>So looks like the problem is in jdbc. How can i force to apply long usernames in SQL operations?
  (com.mysql.jdbc (5.1.24))</p>
  
  <p>Query String:</p>
  
  <pre><code>st.execute("CREATE USER '"+user+"'@'localhost' IDENTIFIED BY 'nothing';");
  st.execute("SET PASSWORD FOR '"+user+"'@'localhost' = PASSWORD('"+passwd+"');");
  </code></pre>
  
  <p>Stack Trace:</p>
  
  <pre><code>java.sql.SQLException: String '...long username...' is too long for user name (should be no longer than 16)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.ja$
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
  at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2809)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2758)
  at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:894)
  at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:732)
  </code></pre>