Learn about Centmin Mod LEMP Stack today
Become a Member

Master 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

    55,182
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    9:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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.

    ./mysqladmin_shell.sh multidb

    prompts for a file path to a dblist.txt file which contains one entry per line in the format of:

    dbname dbusername dbpassword
    db2name db2username db2password

    for example if /home/dblist.txt contains dbname, dbusername and dbpassword

    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...

    Centmin Mod Github Master branch

    Master branch is where most recent commits are made as at May 24, 2015.