Username length limit

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
cyrusmith
Posts: 2
Joined: Thu 09 Sep 2010 16:57

Username length limit

Post by cyrusmith » Thu 09 Sep 2010 17:04

I get confusing error when try to connet to remote db via tunnel.php script.
Db username is test_izumgoroda_ru, and error message text is Access denied for user 'test_izumgoroda_'@'vm-zdd16.host.ru' (using password: YES).

Well, if I set username to something like abcdefghijklmnopqrstuvw, then error is "Access denied for user 'abcdefghijklmnop'@'vm-zdd16.host.ru' (using password: YES)"

It looks like there is a limit to username length (16 characters)

So how cat i connect to my db server if username is greater than 16 chars?

.jp
Devart Team
Posts: 345
Joined: Wed 09 Sep 2009 06:55
Location: devart

Post by .jp » Fri 10 Sep 2010 09:25

The "Access denied for user 'test_izumgoroda_'@'vm-zdd16.host.ru' (using password: YES)." message is thrown by the MySQL server. And it's likely that your MySQL server is of version 4 or earlier.

The problem is that MySQL of the version 4 allows to create a user with name longer than 16 symbols, but it cuts it to 16 symbols without informing about it. Pay attention that even in the message you've sent (Access denied for user 'test_izumgoroda_'...) the username is not "test_izumgoroda_ru" (18 symbols), but "test_izumgoroda_"(16 symbols). In MySQL version 5 the message "String 'test_izumgoroda_ru' is too long for user name (should be no longer than 16)" is thrown when you are trying to create a username longer than 16 symbols. We recommend you to create a user with a name up to 16 symbols or use a newer version of MySQL.

See also: http://dev.mysql.com/doc/refman/5.1/en/grant.html

Note: GRANT supports host names up to 60 characters long. Database, table, column, and routine names can be up to 64 characters. User names can be up to 16 characters.

Thanks.

cyrusmith
Posts: 2
Joined: Thu 09 Sep 2010 16:57

Post by cyrusmith » Fri 10 Sep 2010 14:43

Thanks for the reply!

But it does not solve my problem. Version of my hosting provider MYSQL is 5.1.47.

PS. My old good SQLyog connects (with tunneling also) to the same hosting machine without any problem.

Post Reply