Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

MySQL users truncated

Discussion in 'General Discussion' started by hawkmultimedia, Jun 3, 2004.

  1. hawkmultimedia

    hawkmultimedia Registered

    Jun 3, 2004
    Likes Received:
    Trophy Points:
    My host is blaming cpanel for truncating MySQL user names. They append each username with acctname_ and say it supports 17 characters including the acctname and underscore.

    What's happening is, I successfully create a username with 8 characters, go back to the MySQL page, and it lists the name as acctname_usernam, truncating the last character. It is not just a display issue, as when I try to access the database, I cannot access it using acctname_username, but can using acctname_usernam.

    It seems like a simple enough fix, either add a character to the field or trim an entry, something along those lines. What gives?
  2. IdeaHamster

    IdeaHamster Member

    Feb 5, 2003
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Reseller Owner
    Needs a change to the username field on the form

    I've just encountered this as well.

    I would suggest that because this is a limitation of the version of mySQL used in the WHM/cPanel environment that the username form field on the mySQL page of cPanel be dynamically restricted to the remaining available characters after the account name and "_" have been added.

    So something like say if the account name is "attiworl" then that plus the "_" makes 9 characters so then the "maxlength=" attribute of the username form field would be "7".

    I don't quite understand, other than maybe performance issues, why the mySQL user would be restricted to varchar(16) binary. Even so I owuld have thought that the user column in the mysql tables would be keyed so you be able to have a user ID instead of the characters. Oh well. I'm not a mySQL developer yet...
  3. cPDan

    cPDan cPanel Staff Staff Member

    Mar 9, 2004
    Likes Received:
    Trophy Points:
    mysql> describe mysql.user;

    | User | varchar(16)
    "MySQL usernames can be up to 16 characters long. Operating system usernames
    might have a different maximum length. For example, Unix usernames typically are
    limited to eight characters."

    And the account_ prepend makes it so you can track, not only who it belongs to for managing but also for disk usage for quotas.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice