User database name lenght problem

[expired user #4680]'s profile image [expired user #4680] posted 14 years ago in General Permalink
Sorry of my English.
I use Heidi 5. If my user name database is 17 chars - heidi use only 16 chars. I cant login to my mysql.
Please help.
ansgar's profile image ansgar posted 14 years ago Permalink
HeidiSQL just follows the MySQL implementation, which says the user name can have a maximum length of 16 chars. You can see that in your table mysql.user - the column "User" is defined as VARCHAR(16). See screenshot:



... and the docs: http://dev.mysql.com/doc/refman/5.0/en/user-names.html
1 attachment(s):
  • username16chars
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
My provider genarated automatically user name. This user name is 17 chars.
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
If I use NAVICAT 8 - is OK.
ansgar's profile image ansgar posted 14 years ago Permalink
Oh.. really? Well, I could easily extend the maximum length of the username input field. Only I thought it would not help either if the server is not able to process such long usernames.
[expired user #1821]'s profile image [expired user #1821] posted 14 years ago Permalink
@togropl
it sounds quite impossible what you're describing.

first: it is impossible to store a string that is longer then the defined length of the (var)char column. Mysql will always either cut it of (and generate a warning) or throw an error (in strict mode)

second: it is simply not possible to create a username longer than 16 characters. some prove:

CREATE USER seventeencharacte;//
/* SQL Error (1470): String 'seventeencharacte' is too long for user name (should be no longer than 16) */


So, it's only preferable that heidi doesn't allow this either (to avoid confusion)
ansgar's profile image ansgar posted 14 years ago Permalink
Well I don't think togropl is lying. Probably his hoster has compiled modified sources of the MySQL server in a way that it accepts longer usernames. Sounds odd but obviously the case here.
[expired user #1821]'s profile image [expired user #1821] posted 14 years ago Permalink
> Well I don't think togropl is lying

I'm sorry if it sounded like i was implying that! I didn't mean to do that at all!

I just wanted to make a strong point why heidi shouldn't change it's current behaviour smile
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
Provider - home.pl - POLAND. Check.
ansgar's profile image ansgar posted 14 years ago Permalink
Someone should cut their balls for providing a hacked MySQL server...
ansgar's profile image ansgar posted 14 years ago Permalink
togropl: I just checked that and wonder that the username input field already allows unlimited length of text. So I guess you are using an old version of HeidiSQL? You should update at least to the 5.0 beta in that case.
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
I use Heidi 5.
ansgar's profile image ansgar posted 14 years ago Permalink
Well, then you should be able to enter your long username, but you said you could not, so what's the problem now?
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
I dont now.
My Heidi is 5.0.0.3049 (today upgraded).
User name is 17 chars. Heidi use 16 chars.
ansgar's profile image ansgar posted 14 years ago Permalink
> Heidi use 16 chars

Well, that was what I wanted to tell you - Heidi allows longer usernames, you should see that in the session manager, don't you?
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
In session manager I write 17 chars. Heidi read only 16 chars.
ansgar's profile image ansgar posted 14 years ago Permalink
Where exactly do you see that limitation to 16 chars? I see no code which cuts off the username.
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
I have two databases. Name of one of them has 16chars and the second 17 chars, but they differ only the last char (my provider adds next number at the end of the name of the second database). Both databases have the same password. When I Login to the first database with 16 chars there is everything ok but when I try to login to the second (17 chars) then Heidi login me to the first database - cut this 17th chars.
When I change password to the second database I can't login.
ansgar's profile image ansgar posted 14 years ago Permalink
Ok, understand. So you were just guessing that Heidi cuts at 16 chars. In fact Heidi does not cut your username, I checked that.

I think that the server, not the client library has this limitation, but I may be wrong - in which case it may help to check if Navicat uses a different libmysql.dll and place that one into your heidisql directory.
[expired user #4580]'s profile image [expired user #4580] posted 14 years ago Permalink
Hi,
perhaps togropl is saying that DATABASE names, not USER names are truncated at 16 chars
[expired user #4756]'s profile image [expired user #4756] posted 14 years ago Permalink
@togropl
Hi! I have the same problem on home.pl
I have 18 chars domain and my database is name after domain and also has 18 chars. Every another database is domain+digit (1,2,3) so it will be 19 chars.
Username is the same name as database, and home.pl claims, that he cannot add another user or change user name. I do not know what to do.
User in MySQL must be max 16 char.
Did you solve your problem?
ansgar's profile image ansgar posted 14 years ago Permalink
Yes, would be nice to get feedback from togropl if the libmysql.dll hint fixed something.
[expired user #4680]'s profile image [expired user #4680] posted 14 years ago Permalink
No. libmysql.dll is not fixed.

Please login to leave a reply, or register at first.