Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    6

    Default Create Database with underscore in the name

    I can not seem to get cPanel to let me create a database with an underscore in the name.

    I know about the username scheme, but what I would like to do is create a database name like dbase_name, so that what is created is username_dbase_name. When I do, cPanel says it created the database, but when I go back to the databases page, it is not there. No error message, but no database, so I assume it actually failed.

    Is there any way to put an underscore in the database name?

  2. #2
    Member
    Join Date
    Aug 2008
    Posts
    48

    Default

    All of our databases follow a similar format to what you're trying to do.

    What you'll want to try is generating the SQL for the database you'd like to create and add a call to the SQL in /scripts/postwwwacct (runs after an account is created).

    So
    $user = $OPTS{'user'};
    Will get the account name.

    Simply pass that to the function you create that makes the database.

  3. #3
    Member
    Join Date
    Aug 2008
    Posts
    48

    Default

    Quote Originally Posted by cycletourist View Post
    I can not seem to get cPanel to let me create a database with an underscore in the name.

    I know about the username scheme, but what I would like to do is create a database name like dbase_name, so that what is created is username_dbase_name. When I do, cPanel says it created the database, but when I go back to the databases page, it is not there. No error message, but no database, so I assume it actually failed.

    Is there any way to put an underscore in the database name?
    An after thought:

    Did you try checking the phpMa page as root to see if the database showed up there?

  4. #4
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    Only alphanumeric characters (letters and numbers) may be entered for the database name. In cPanel version 11.25 the behavior is corrected to better validate input for the database name, specifically displaying a message like the following when an underscore is entered:
    Code:
    Database name must be alphanumeric characters

  5. #5
    Member
    Join Date
    Mar 2003
    Posts
    6

    Default

    Quote Originally Posted by kbuser View Post
    An after thought:

    Did you try checking the phpMa page as root to see if the database showed up there?
    Thanks for the suggestions, but I don't have root access.

  6. #6
    Member
    Join Date
    Mar 2003
    Posts
    6

    Default

    Quote Originally Posted by cPanelDon View Post
    Only alphanumeric characters (letters and numbers) may be entered for the database name.
    Thanks for making that perfectly clear. Now I can quit trying to figure out how it might be done (escaped somehow?).

    A clear error message would be a good thing, but I'm confused. My cPanel says: cPanel Version 11.25.0-CURRENT 40255, yet it simply tells me:

    Database Created
    Added the database dbase_name.

    As to not being able to use an underscore, I guess it's not a simple thing for cPanel to separate the significance of the first underscore from succeeding ones.

    Thanks for the reply,
    Chuck

  7. #7
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    Quote Originally Posted by cycletourist View Post
    Thanks for making that perfectly clear. Now I can quit trying to figure out how it might be done (escaped somehow?).

    A clear error message would be a good thing, but I'm confused. My cPanel says: cPanel Version 11.25.0-CURRENT 40255, yet it simply tells me:

    Database Created
    Added the database dbase_name.

    As to not being able to use an underscore, I guess it's not a simple thing for cPanel to separate the significance of the first underscore from succeeding ones.

    Thanks for the reply,
    Chuck
    What cPanel theme and style was used when entering in the database name? (e.g., x3 with the default style, or a third-party theme)

    I used EDGE when testing initially, but I re-tested this time using CURRENT; the following two builds were used:
    11.25.0-EDGE_40716
    11.25.0-CURRENT_40255

    When testing CURRENT using x3 and the default style, it displayed the same message. Of many, here is one of the example strings entered: "ab1_cd2" (does not include the account username) -- this resulted in the following message: "Database name must be alphanumeric characters."

  8. #8
    Member
    Join Date
    Mar 2003
    Posts
    6

    Default

    Quote Originally Posted by cPanelDon View Post
    What cPanel theme and style was used when entering in the database name? (e.g., x3 with the default style, or a third-party theme)

    I used EDGE when testing initially, but I re-tested this time using CURRENT; the following two builds were used:
    11.25.0-EDGE_40716
    11.25.0-CURRENT_40255

    When testing CURRENT using x3 and the default style, it displayed the same message. Of many, here is one of the example strings entered: "ab1_cd2" (does not include the account username) -- this resulted in the following message: "Database name must be alphanumeric characters."
    From cPanel:
    cPanel Version 11.25.0-CURRENT 40255
    Theme cPanel X v2.6.0

    I use bluelagoon everywhere. I like (or am used to) the appearance. It must be third party (and outdated), though, as I just switched to x3 and now I see the error message just as you say. I also see some features I've not seen before (MySQL Database Wizard, for one). Guess I'll switch over on all my cPanel accounts.

    Thanks for you assistance and your patience.

    Chuck
    Last edited by cycletourist; 11-02-2009 at 11:04 PM.

  9. #9
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    Quote Originally Posted by cycletourist View Post
    I use bluelagoon everywhere. I like (or am used to) the appearance. It must be third party (and outdated), though, as I just switched to x3 and now I see the error message just as you say. I also see some features I've not seen before (MySQL Database Wizard, for one). Guess I'll switch over on all my cPanel accounts.

    Thanks for you assistance and your patience.

    Chuck
    While the bluelagoon theme is deprecated, it lives on in a x3 style after the same name; the bluelagoon x3 style happens to be what I used when testing on EDGE earlier (as I'm also fond of the bluelagoon appearance).

    Here is our documentation for more information on how to change the style (while logged-in as the user in cPanel):
    OtherFeatures < AllDocumentation/CpanelDocs < TWiki

    The menu path in cPanel is as seen below:
    cPanel: Preferences >> Change Style

    It's also possible to set the bluelagoon style as the default style using the Branding Editor via the WHM control panel; here is our related documentation detailing this further:
    Branding < AllDocumentation/CpanelDocs < TWiki

    Here is the menu path in WHM to locate where to set a new default style:
    WHM: Main >> cPanel >> Branding >> x3 [edit live]
    * Once on the above page (after clicking the edit live link), look for your preferred style and click "Set Default for New Accounts" to set it as the new default, or click "Apply to All Accounts" to have it be applied immediately to all accounts.

Similar Threads & Tags
Similar threads

  1. How to create a new database
    By jimlafleur in forum Database Discussions
    Replies: 1
    Last Post: 04-26-2011, 02:18 PM
  2. How to create a new database?
    By Chad Warden in forum New User Questions
    Replies: 1
    Last Post: 04-24-2011, 03:23 PM
  3. Replies: 0
    Last Post: 05-29-2006, 12:31 PM
  4. cPanel database with no underscore
    By btrieve in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-30-2005, 08:25 PM
  5. databases with an underscore in their name
    By shar in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-14-2003, 06:00 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube