The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL users truncated

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

  1. hawkmultimedia

    hawkmultimedia Registered

    Joined:
    Jun 3, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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

    Joined:
    Feb 5, 2003
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Auckland
    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

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    mysql> describe mysql.user;

    | User | varchar(16)

    http://dev.mysql.com/doc/mysql/en/User_names.html
    "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.
     
Loading...

Share This Page