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

Discussion in 'General Discussion' started by Phoenix cg, Feb 21, 2008.

  1. Phoenix cg

    Phoenix cg Member

    Joined:
    Feb 21, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I'm running a backup database, I need to create a user without doing it in the cpanel, is it possible to do it in SQL so all i need to do is run a backup and it will install the user for me too?

    the accounts im running it on use the same username (not the initial part) example

    fiftyone_phoenix
    thirtytwo_phoenix

    and they use the same password.

    is it possible to run a backup that also installs the user not just the db
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    User access is stored in the mysql database. A user database does not store access information. So if you did not alter the mysql user table then the access permissions would still be available providing the user database names did not change.

    To manually add user privileges to a database, you would use a query such as this on the mysql command line:

    GRANT ALL PRIVILEGES ON `fiftyone\_*`.* TO 'username'@'localhost' IDENTIFIED BY 'password'
    WITH GRANT OPTION;

    so any database that fiftyone has, the user will have access. If there is a user that should have access to only one of the databases owned by fiftyone, then name the database explicitly without the wildcard.
     
  3. Phoenix cg

    Phoenix cg Member

    Joined:
    Feb 21, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    thanks for the reply, i'll give that a try, i also have another question

    altho most probably should make a new thread for it, is there a way to automatically install a sql database when a new account is created?
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    I get the feeling you are wanting to provide a generic database to each new account upon creation?

    If you are referring to user accounts moving to your server with existing databases, you can use the restore backup function in cpanel.
     
  5. Phoenix cg

    Phoenix cg Member

    Joined:
    Feb 21, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I have a generic database, but what I'm doing is developing around 1000 sites for charities, they will use the same databases, but when i create each new user i have to run the mysql backup, so you can guess how daunting this is to do 1000 manually, i also need to change the softwares config file, (joomla)

    so you can imagine the amount of repetition this project has and its quite daunting, so if you know any possible way of making it easier for me thatd be really helpful
     
  6. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Ahhh.. Gotcha.. Perhaps someone else could chime in if theres a known solution. Good luck.
     
  7. Phoenix cg

    Phoenix cg Member

    Joined:
    Feb 21, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    i hope someone could, it's quite longgggg, is there any bespoke solutions?
     
Loading...

Share This Page