Mysql 5.0.91 to MySQL 5.1.48 username problem

Tymsah

Well-Known Member
Apr 6, 2007
151
0
166
cPanel Access Level
Root Administrator
Hi,

today upgrade Mysql 5.0.91 to MySQL 5.1.48 all username cut maximum length 16.

some customer username length 18-20 .

hoe can i fix ?


Regards,
Tymsah
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,606
33
238
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello Tymsah,

Are you stating that previously longer database usernames now aren't working or that you are trying to create a new database username that isn't letting you do so due to the length?

From my understanding, previously long database usernames should still have been working after the upgrade and you simply cannot have long database usernames going forward. Please clarify if this is impacting already previously created users or this is for a new database user that's trying to be created.

Thank you.
 

Tymsah

Well-Known Member
Apr 6, 2007
151
0
166
cPanel Access Level
Root Administrator
Hi,

im change mysql database username column length 16 to 20
and manual update usernames and site is running

because php files is encoded zend. i cant change db usernames.

:)
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,578
52
308
cPanel Access Level
Root Administrator
MySQL has long had a limitation of 16 characters for the user name. In versions prior to MySQL 5.1 the server would accept user names longer than 16 characters during the authentication handshake.

Beginning with MySQL 5.1 the database server will either truncate those user names or simply reject the authentication handshake.

Your recourse is:

1. Rollback to MySQL 5.0; or
2. Change the database user names to be 16 characters or less
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,606
33
238
somewhere over the rainbow
cPanel Access Level
Root Administrator
I had tried to find this documentation previously and wasn't able to find it at that time (while MySQL has great documentation, finding the documentation is sometimes a challenge), and so wasn't sure in my last reply if it was really hard-coded.

Here's the reference on the 16 character limit for MySQL usernames in MySQL 5.1:

MySQL :: MySQL 5.1 Reference Manual :: 5.5.1 User Names and Passwords
 

manokiss

Well-Known Member
Mar 31, 2002
575
0
316
Hi there, wondering if the username length is calculated with the cpanel username on front or without it?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,606
33
238
somewhere over the rainbow
cPanel Access Level
Root Administrator
The full length of the username is whatever it shows in cPanel for the MySQL username. If a system has database prefixing on, then the cPanel username will always be prepended to the front of the username with a _ after it. If the system has database prefixing turned off, then the customer determines in cPanel whether to use the cPanel username or not as part of the MySQL username.

Since MySQL uses the full username selected, it is going to count all characters of the username. You could turn off database prefixing in WHM > Disable Database Prefix if you wish to turn off using the cPanel username at the front of the MySQL username.