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.

Create MySQL user and database with same name as cPanel user

Discussion in 'Database Discussions' started by DanH42, Jun 2, 2014.

  1. DanH42

    DanH42 Active Member

    Joined:
    Sep 11, 2011
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bloomington, IL
    cPanel Access Level:
    Root Administrator
    Let's say I have a cPanel user called "example". This user can create MySQL users and databases, provided that they are prefixed with "example_".

    I'd like to set up a MySQL user called "example" (no underscore or anything), and a database by the same name. I'm in the process of migrating a large number of sites from an old server where this was the convention, and being able to do this would greatly simplify the process, since I wouldn't have to update all the config files to reflect new usernames and database names.

    Is there a way to accomplish this? As long as the cPanel user ultimately has control of the account through phpMyAdmin, I don't care if I have to create the user/database from a WHM admin account. I see a "Disable Database Prefix' option, but besides being minimally explained in the documentation, I'd like any subsequent users and databases to be prefixed as they are normally.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    You can disable database prefixing, but you can not have prefixing enabled for some accounts/databases and disabled for others. Typically, disabling database prefixing is the best way to handle the issue you have described. Databases and database users are still controlled by the user even if no prefix is used.

    Thank you.
     
  3. DanH42

    DanH42 Active Member

    Joined:
    Sep 11, 2011
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bloomington, IL
    cPanel Access Level:
    Root Administrator
    Thanks for the clarification. With that in mind, I've gone ahead and created a feature request, so we'll see if that goes anywhere.
     
Loading...

Share This Page