Want more timely Centmin Mod News Updates?
Become a Member

Hi all...

Discussion in 'Introductions' started by GhoHan, Jun 22, 2014.

  1. GhoHan

    GhoHan Member

    32
    13
    8
    Jun 1, 2014
    Ratings:
    +13
    Local Time:
    6:16 PM
    1.7.X
    10.X
    HI all i am new to this community :)
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:16 PM
    Nginx 1.13.x
    MariaDB 5.5
    Hi @GhoHan and welcome :)

    Hoping there's enough info within the community and on the site http://centminmod.com/ to entice you to have a play and try out Centmin Mod web stack - it's what the community forum's themselves are run :D
     
  3. GhoHan

    GhoHan Member

    32
    13
    8
    Jun 1, 2014
    Ratings:
    +13
    Local Time:
    6:16 PM
    1.7.X
    10.X
    i follow you since on vbulletin.com :)
    since you told there now i always use centminmod on all my client server :)
    but I do not know how to say thanks for you.
    Regards
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:16 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. GhoHan

    GhoHan Member

    32
    13
    8
    Jun 1, 2014
    Ratings:
    +13
    Local Time:
    6:16 PM
    1.7.X
    10.X
    • Like Like x 1
  6. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:16 PM
    Nginx 1.13.x
    MariaDB 5.5
    Thanks hopefully .07 beta will become a stable release sooner rather than later :)
     
  7. GhoHan

    GhoHan Member

    32
    13
    8
    Jun 1, 2014
    Ratings:
    +13
    Local Time:
    6:16 PM
    1.7.X
    10.X
    don't forget to addons Bash script to create MySQL database and user :)
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:16 PM
    Nginx 1.13.x
    MariaDB 5.5
  9. GhoHan

    GhoHan Member

    32
    13
    8
    Jun 1, 2014
    Ratings:
    +13
    Local Time:
    6:16 PM
    1.7.X
    10.X
    yeah i have use that :)
    but not effecient every time must open and login first to browser :)
    i found this bash script on cyberciti and i try to modify the command is error but when echo and then copy paste the command is right no error
    Code:
    #!/bin/bash
    # A shell script to add mysql database, username and password.
    # It can also grant remote access on fly while creating the database.
    # -------------------------------------------------------------------------
    
    _db="$1"
    _user="$2"
    _pass="$3"
    _dbremotehost="$4"
    _dbrights="$5"
    
    ## Path to mysql bins ##
    mysql="mysql"
    
    ## Mysql root settings ##
    _madminuser='root'
    _mhost='localhost'
    
    # make sure we get at least 3 args, else die
    [[ $# -le 2 ]] && { echo "Usage: $0 'DB_Name' 'DB_USER' 'DB_PASSORD' ['remote1|remote2|remoteN'] ['DB_RIGHTS']"; exit 1; }
    
    echo -n "Enter the MySQL root password: "
    read -s _madminpwd
    echo ""
    
    # fallback to ALL rights
    [[ -z "${_dbrights}" ]] && _dbrights="ALL"
    
    # build mysql queries
    _uamq="${mysql} -u ${_madminuser} -h "${_mhost}" -p${_madminpwd} -e \"CREATE DATABASE ${_db}\";"
    _upermq1="${mysql} -u "${_madminuser}" -h "${_mhost}" -p${_madminpwd} -e \"GRANT ${_dbrights} ON ${_db}.* TO ${_user}@'localhost' IDENTIFIED BY '${_pass}'\";"
                                                               
    # run mysql queries
    # modify to echo mode
    echo $_uamq
    echo $_upermq1
    
    # read remote host ip in a bash loop
    # build queires to grant permission to all remote webserver or hosts via ip using the same username
    IFS='|'
    for i in ${_dbremotehost}
    do
      _upermq2="${mysql} -u "${_madminuser}" -h "${_mhost}" -p${_madminpwd} -e \"GRANT ${_dbrights} ON ${_db}.* TO ${_user}@${i} IDENTIFIED BY '${_pass}';\""
        echo $_upermq2
    done
    
    this bash script use so simple:
    # ./sql.sh db_name db_user db_pass
    # ./sql.sh db_name db_user db_pass '192.168.1.1|192.168.1.2|192.168.1.3' 'SELECT,INSERT,UPDATE,DELETE'
    OR
    # ./sql.sh db_name db_user db_pass '192.168.1.1|192.168.1.2|192.168.1.3' ALL

    i hope you can fix
    this bash script just refference only :)
     
    Last edited: Jun 22, 2014
  10. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:16 PM
    Nginx 1.13.x
    MariaDB 5.5
    Thanks for linking to that script. Right now don't have plans for shell version but maybe in the future.

    What did you try editing that caused an error ?

    FYI, might be easier if you made your own preset one liner SSH commands for your own use. Depending on your SSH client software you can even make bookmark/button preset commands. I do this for SecureCRT SSH client myself https://community.centminmod.com/threads/what-sftp-ftp-and-ssh-client-apps-do-you-use.390/ :)
     
  11. GhoHan

    GhoHan Member

    32
    13
    8
    Jun 1, 2014
    Ratings:
    +13
    Local Time:
    6:16 PM
    1.7.X
    10.X
    thanks for your information, i will try.
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:16 PM
    Nginx 1.13.x
    MariaDB 5.5