Learn about Centmin Mod LEMP Stack today
Become a Member

Beta Branch update mysqladmin_shell.sh fix dbnames with hyphens in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jan 4, 2017.

  1. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    8:22 AM
    Nginx 1.13.x
    MariaDB 5.5
  2. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    8:22 AM
    Nginx 1.13.x
    MariaDB 5.5
    test with database name with hyphen
    Code (Text):
    ./mysqladmin_shell.sh setuserdb
    --------------------------------------------------------------
    Basic MySQL Admin - create mysql user & databases
    --------------------------------------------------------------
    --------------------------------------------------------------
    
     Do you want to create a new MySQL username (type = y) or
     Add a new database name to existing MySQL username (type = n) ?
     Enter y or n: y
    ---------------------------------
    Create MySQL username:
    ---------------------------------
     Enter new MySQL username you want to create: nu7
     Enter new MySQL username's password: np7
    ---------------------------------
    Create MySQL database:
    ---------------------------------
     Enter new MySQL database name: new-db7
    
    Grants for nu7@localhost
    GRANT USAGE ON *.* TO 'nu7'@'localhost' IDENTIFIED BY PASSWORD '*A4722548F81AE352177C04E5C1786F8A1B152687'
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON `new-db7`.* TO 'nu7'@'localhost'
    
    Ok: MySQL user: nu7 MySQL database: new-db7 created successfully
    

    test multidb mode with dbname with hyphen where /home/dblist.txt contains following db, user, pass pairs per row
    Code (Text):
    dbname11 dbuser11 dbpass11
    dbname22 dbuser22 dbpass22
    db-name11 dbuser33 dbpass33
    db-name22 db-user44 db-pass44
    

    Code (Text):
    ./mysqladmin_shell.sh multidb /home/dblist.txt
    --------------------------------------------------------------
    Basic MySQL Admin - create mysql user & databases
    --------------------------------------------------------------
    --------------------------------------------------------------
    
    ----------------------------------------------------------------------------
    Create Multiple MySQL Databases, User & Pass From specified filepath/name
    i.e. /home/nginx/domains/domain.com/dbfile.txt
    One entry per line in dbfile.txt in format of:
    databasename databaseuser databasepass
    ----------------------------------------------------------------------------
    
    ---------------------------------
    Ok: MySQL user: dbuser11 MySQL database: dbname11 created successfully
    
    
    ---------------------------------
    Ok: MySQL user: dbuser22 MySQL database: dbname22 created successfully
    
    
    ---------------------------------
    Ok: MySQL user: dbuser33 MySQL database: db-name11 created successfully
    
    
    ---------------------------------
    Ok: MySQL user: db-user44 MySQL database: db-name22 created successfully
    
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    8:22 AM
    Nginx 1.13.x
    MariaDB 5.5