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 database names

Discussion in 'General Discussion' started by wills, Aug 5, 2003.

  1. wills

    wills Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    202
    Likes Received:
    1
    Trophy Points:
    18
    Is there a way to change the name of the mySQL databases in the back-end? I have a customer that wants to do this so that its not like USER_DATABASENAME format, I guess he is in transition of moving over the site and his scripts are all pointing to his old database name which is just a simple DATABASE name.

    cPanel.net Support Ticket Number:
     
  2. NetX

    NetX Well-Known Member

    Joined:
    Jun 18, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    You can export all tables of DATABASE, after, create a db user_databasename and import your tables.

    cPanel.net Support Ticket Number:
     
  3. wills

    wills Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    202
    Likes Received:
    1
    Trophy Points:
    18
    I think I might have explained it incorrectly. I'm wondering if there is a way to remove the account ID (USERNAME_DATABASE) from the SQL databases name(s)?

    Same with the username for the databases. Sorry, this is one of those really odd questions that never comes up. In my opinion its uneccessary to change this but I want to accomodate the customer's needs :)

    cPanel.net Support Ticket Number:
     
  4. NetX

    NetX Well-Known Member

    Joined:
    Jun 18, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    Ok wills. Yes, it is possible use a different name of database for a user; you will have to do it manually.

    1) Access phpmyadmin as root.
    2) Create the database that you want in format DATABASENAME without any ID.
    3) Import tables
    4) Then you have to add privileges to respective user in order to access DATABASENAME.
    5) Reload mysql

    And all will be done. ;)

    cPanel.net Support Ticket Number:
     
    #4 NetX, Aug 5, 2003
    Last edited: Aug 5, 2003
  5. mjm

    mjm BANNED

    Joined:
    Aug 1, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    rename database should be implemented in mySQL 5.1

    cPanel.net Support Ticket Number:
     
  6. wills

    wills Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    202
    Likes Received:
    1
    Trophy Points:
    18
    to run phpmyadmin as root, which variable do I need to configure in config.inc.php? I hate not knowing :(

    And its good to know that this will be possible in 5.1!

    NetX, thanks for the input, its very classy of you to show me how to do this!

    cPanel.net Support Ticket Number:
     
  7. NetX

    NetX Well-Known Member

    Joined:
    Jun 18, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    wills, in your config.inc.php3 file just setup cookie based and left blank user and password:

    $cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?
    $cfg['Servers'][$i]['user'] = ''; // MySQL user
    $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

    Good look! ;)

    cPanel.net Support Ticket Number:
     
  8. wills

    wills Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    202
    Likes Received:
    1
    Trophy Points:
    18
    got it, I guess the restart had failed through WHM so I had to do it through SSH.

    One more question, if I do this then there is no way to control the quota on the database disk limit, is there?

    cPanel.net Support Ticket Number:
     
  9. NetX

    NetX Well-Known Member

    Joined:
    Jun 18, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    Ho, in this way the database is not considering for quota.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page