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.

Database prefix length

Discussion in 'Database Discussions' started by ravijas, Jul 24, 2014.

  1. ravijas

    ravijas Member

    Joined:
    Jul 24, 2014
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello,

    We recently upgraded cPanel version to 11.44 and since then, we are facing problems with Database prefix length. New cPanel version allows cPanel usernames with more than 8 characters, But the same is not applied for database prefix for database user. The database prefix is still can not have more than 8 characters. and this is causing serious issues on our Shared cPanel server. If we disable Database prefix in /var/cpanel/cpanel.config file, then the situation becomes worst because there can not be two same named databases on the server. for example, If database prefix is disabled, then database is created without cPanel username. Say, we install wordpress through Fantastico, then the first user on the server will be created as wrdp1 and the second database user will not be created as wrdp1 will already exist on the server. We have hundreds of customers using MYSQL databases and many are facing problems. Please check it and make sure the database username and database name comes with a prefix with more than 8 characters.

    Looking forward to your reply.

    RaviJas.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,764
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you elaborate a bit more on this problem? For instance, do you mean that users will have to switch the default database name used by a third-party application such as Fantastico, or are there other scenarios where there are problems? How exactly is the 8-character database prefix limit causing issues?

    Note that you may also find the following blog post informative:

    Update to Recent Database Prefixing Post | cPanel Blog

    Thank you.
     
  3. SagarJax

    SagarJax Registered

    Joined:
    Jul 29, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hello,

    Thank you for your prompt attention towards our query

    We've already placed a ticket for the mentioned issue on the cPanel customer Portal and the ticket ID for the mentioned issue is : 5243939 .

    Still, I'll elaborate the issue for you regarding the cPanel update.
    As the cPanel is upgraded now along with the feature of creating the username with more than 8 characters, so when anybody creating the account from the WHM it is getting created but with the username of more than 8 characters. This is also acceptable. But, the main issue comes when we install any script from fantastico like wordpress the database is getting created (e.g. usernamelongerthaneight_wrdp1) but it gives the error as (e.g.You do not own the user (usernamelongerthaneight_wrdp1).. This is not acceptable. The feature in cPanel "Mysql Databases" is not accepting the database username with the prefix of more than 8 characters. That is why fantastico is not able to create the database username. This should be the bug in the latest cPanel update.




     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,764
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To update, the user has reported the issue to Fantastico directly and received a response from Fantastico that a patch is in the works for their application.

    Thank you.
     
  5. ravijas

    ravijas Member

    Joined:
    Jul 24, 2014
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello,

    Fantastico support has resolved the problem now.

    Thanks.
     
  6. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    92
    Likes Received:
    1
    Trophy Points:
    8
    Username length

    WHM 11.44.1 (build 15)

    I noticed I am now allowed to use longer than 8 character usernames when creating a new account in WHM. Great!

    Using the new account I created a WordPress install using Fantastico (using the X3 theme because it seems Paper Lantern doesn't work with Fantastico for some reason, see my other post).

    When I tried using it I got a database error. That is when I realised Fantastico was gladly using the longer username but MySQL was not. So in the WordPress wp-config file the full username was prepended to the database and database user name, but the actual database name and database username had been truncated to 8 characters!

    So...is that correct? We are allowed to make usernames longer than 8 characters but MySQL will truncate them to 8? This seems bad.

    Was this intended?

    PS: Yes, I know how to fix the WordPress install...I'm just concerned about this manifesting itself elsewhere and becoming a support issue.

    Thanks
     
  7. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    92
    Likes Received:
    1
    Trophy Points:
    8
    Re: Username length

    Well, that is interesting. I figured I just change the database name and database username in the wp-config.php to match the truncated names and it would start working. Nope. Not sure why yet.
     
  8. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    92
    Likes Received:
    1
    Trophy Points:
    8
    Isn't this is a serious issue? What if two re-sellers using WHM create separate accounts with usernaes like this:

    billybobjoe55

    billybobjoe77

    No problem because usernames can now be more than 8 characters. But what if each of these accounts creates a mysql database which truncates the username to 8 characters, effectively creating the SAME username "billybob_database"?

    Using an automated installer like fantastico it is going to pick a default database name like billybob_wpdb1, which is going to cause an issue since billybob_wpdb1 would already exist.
     
  9. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    509
    Likes Received:
    64
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    You wouldn't be able to create two users with the same first 8 characters. They must be unique.
     
  10. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    92
    Likes Received:
    1
    Trophy Points:
    8
    So, that is something that is being checked at account creation time? I wasn't sure.
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,764
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, attempting to create the second user would result in a failure based on having the same first eight characters.

    Thank you.
     
Loading...

Share This Page