Welcome to Centmin Mod Community
Become a Member

Beta Branch update addons/mysqladmin_shell.sh add multi database creation support & fix root prompt

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jul 19, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    30,969
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    2:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    update addons/mysqladmin_shell.sh add multi database creation support & fix root prompt

    root prompt is not needed with .08 beta03+ and higher as /root/.my.cnf has a record of the mysql root password which is auto generated on initial Centmin Mod install

    For multiple database support, a new multidb option was added which can mass create databasenames, passwords and user from a specified text file. You only need to enter path to that file at prompt.
    Code:
    ./mysqladmin_shell.sh multidb
    
    prompts for a file path to a dblist.txt file which contains one entry per line in the format of:
    Code:
    dbname dbusername dbpassword
    db2name db2username db2password
    
    for example if /home/dblist.txt contains dbname, dbusername and dbpassword
    Code:
    Enter full path to db list file i.e. /home/nginx/domains/domain.com/dbfile.txt (to exit type = x): /home/dblist.txt
    
    Grants for dbusername@localhost
    GRANT USAGE ON *.* TO 'dbusername'@'localhost' IDENTIFIED BY PASSWORD '*6207EE3F049D8F87CC0B4BBB8814917B31FB8E4F'
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON `dbname`.* TO 'dbusername'@'localhost'
    
    Ok: MySQL user:  MySQL database: dbname created successfully
    
    Grants for db2username@localhost
    GRANT USAGE ON *.* TO 'db2username'@'localhost' IDENTIFIED BY PASSWORD '*59F34589CBECBF3AB16AA51EA7E7C1D8DF068A76'
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON `db2name`.* TO 'db2username'@'localhost'
    
    Ok: MySQL user:  MySQL database: db2name created successfully
    
    Continue reading...

    123.08beta03 branch

    * 123.08beta03 branch is the merging of the 3 branches - .08 beta 02 + 123.08lua + 123.08livestats so the new beta has both Nginx Lua + LuaJIT support + new Nginx vhost traffic statistics
     
    Last edited: Jul 19, 2015