Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2002
    Location
    Westbury, LI NY
    Posts
    1,705

    Ensim SQL command

    When Ensim creates a site, what is the command it uses to create the SQL database and the user for it?

    I could do it by hand in phpMyAdmin, but I just want to know what command it uses.

    Thanks!

  2. #2
    Join Date
    Jan 2002
    Posts
    453
    create database db_name

  3. #3
    Join Date
    Mar 2002
    Location
    Westbury, LI NY
    Posts
    1,705
    nevermind, found it.

    Code:
    #!/bin/sh 
    
    if [ $# != 3 ]; then 
    echo "usage: `basename $0` db user password" 
    exit 1 
    fi 
    
    DB=$1
    USER=$2
    PASS=$3
    
    mysql -u root -p <<!
    create database $DB;
    flush privileges;
    grant all on ${DB}.* to ${USER}@localhost identified by "${PASS}" with grant option;
    !
    
    cat <<!
    Database $DB created
    User: $USER
    Pass: $PASS
    !
    http://ensim.webscorpion.com/modules...=article&sid=3

  4. #4
    Join Date
    Jan 2002
    Posts
    453
    yep, all thats doing is taking arguments 1,2,3 (dbname, username, and pass)

    creating the database
    and then assigning the permisions to that user:pass

  5. #5
    Join Date
    Mar 2002
    Location
    Westbury, LI NY
    Posts
    1,705
    what good is a database with out permissions though?

  6. #6
    Join Date
    Aug 2002
    Location
    Plymouth
    Posts
    212
    But you are using Grant command to give permissions...there are options in it to give permission settings.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •