Skip to main content

Username character limit uniqueness

Comments

8 comments

  • cPanelAnthony
    Hello! I can confirm it is still in play. Two cPanel users cannot share the first eight characters for the username.
    0
  • sparek-3
    You sure? Have you tried it? Have you tried it on cPanel 94.0.19? So, you're saying that if I create an account and use the username [font="courier new">abcdefghijklmno I won't be able to create an account on that same server with the username [font="courier new">abcdefghpqrstuv? I seem to be able to do such an activity. Do I have a setting misconfigured some where?
    0
  • cPanelAnthony
    You sure? Have you tried it? Have you tried it on cPanel 94.0.19? So, you're saying that if I create an account and use the username abcdefghijklmno I won't be able to create an account on that same server with the username abcdefghpqrstuv? I seem to be able to do such an activity. Do I have a setting misconfigured some where?

    Hello! I tested it right out of the box on cPanel version 94 and100 and it wouldn't let me make a username with the same eight characters as another. However, I ended up finding the issue. must be unique on the system.
    It looks like the eight-character limit is needed for MySQL and PostgreSQL. When I switched both of my test VMs from MySQL to MariaDB, the 8 unique character restrictions no longer applied. Are you running MariaDB?
    0
  • sparek-3
    Yes, I'm using MariaDB. Although I really thought this restriction was in place regardless of what SQL service was being used on the server. Although, I really can't say when I last tested the 8 character uniqueness and when I switched all of our servers over to MariaDB. So it's possible (although I don't think it's likely) that I switched to MariaDB after I last tested the first 8 character username uniqueness. I suspect that at some point in time - cPanel dropped the "use the first 8 characters of a username to prepend to a SQL username" and instead considered the type and version of SQL service running on a server and newer versions of SQL services (maybe just MariaDB?) allow for much longer SQL usernames - so the requirement for the first 8 characters of a system username being unique was dropped. I just don't remember seeing a memo about that, but it's entirely possible that this got lost in the release notes some where. I know it used to be, MySQL usernames had a small maximum length (for some reason 17 characters stick out in my mind, but I don't know where I got that). And while that version of MySQL was still popular and heavily in use, cPanel - in their infinite wisdom - decided to allow much longer usernames, up to 16 characters if I remember. But because the "standard" version of MySQL running on most cPanel servers only allowed for a small number of username characters and in order to allow database username uniqueness across system users, the first 8 characters of an account's system username followed by an underscore and then the specified MySQL username was how MySQL usernames were created. This necessitated the first 8 characters of any cPanel system user to be unique. This was all probably before the Oracle debacle with MySQL and when there wasn't really a choice of SQL service - it was MySQL or MySQL. Then cPanel allowed administrators to switch to MariaDB or keep MySQL. MariaDB allowed for longer usernames, but I still believe that cPanel still limited the SQL usernames in order to keep everything the same regardless of if a system was using MySQL or MariaDB. I'm not sure what versions of MySQL cPanel is allowing now. Nor am I sure of what the max SQL username limit is for these versions of MySQL. I'm not sure if the first 8 character username uniqueness is still necessary for creating MySQL usernames. But evidently, some where along the lines cPanel removed the restriction for systems that use MariaDB. With MariaDB, SQL usernames can be the full 16 character system user, and underscore, and then a descriptive string. Just wasn't aware that that had changed.
    0
  • Brian N
    FWIW it was changed LONG ago for MariaDB: 56 Release Notes | cPanel & WHM Documentation However, as you also said, I don't understand why it's still a requirement for MySQL. Even this KB article suggests that the limit should no longer exist with MySQL 5.7:
    0
  • Brian N
    I tried transferring some accounts to a server running MySQL 8.0 and did indeed get username collision errors. So it seems to still be a restriction. At any rate, I put in the feature request below to remove it. Maybe it'll happen one day.
    0
  • cPanelAnthony
    Apologies for not getting back to this more quickly. It does seem to still be a restriction; thank you for updating the thread.
    0

Please sign in to leave a comment.