Is there a tool available to help setup multiple databases?

Discussion in 'MySQL' started by ACrofford, Jun 9, 2008.

  1. #1
    I am wondering if there is a tool available to setup multiple mySQL databases in cPanel or phpmyadmin.

    I am looking for the best tool to use.

    Thanks,
    Ac
     
    ACrofford, Jun 9, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Try Navicat: http://www.navicat.com/

    They have a free trial and a free version for personal usage. I currently manage several hundred DB's effectively with this. You can do just about anything with it and it is worlds better than phpmyadmin.
     
    jestep, Jun 9, 2008 IP
  3. ACrofford

    ACrofford Active Member

    Messages:
    272
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    I want to be able to auto setup mySQL dbs on hosting accounts. Something where you specify the login details for the hosting account and how many DBs you need and it sets them up.
     
    ACrofford, Jun 9, 2008 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    You could write a quick php script to do it if you give the script sufficient permissions. If you have a lot of them, you could make a loop and change the name on each loop.

    
    
    $newDb = 'Db_name';
    
    $query  = "CREATE DATABASE $newDb";
    $result = mysql_query($query);
    
    //then
    
    $query2  = "GRANT SELECT, INSERT, UPDATE, DELETE ON $newDb.* TO 'new_user'@'localhost' IDENTIFIED BY 'user_password'";
    
    $result = mysql_query($query2);
    
    PHP:
     
    jestep, Jun 9, 2008 IP
  5. ACrofford

    ACrofford Active Member

    Messages:
    272
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #5
    ACrofford, Jun 10, 2008 IP