Get the most out of your Centmin Mod LEMP stack
Become a Member

mysqladmin_shell.sh Shell based Addon

Discussion in 'Add Ons' started by eva2000, Jun 23, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    if you use https://strongpasswordgenerator.com/ you can generate passwords with advanced options to avoid punctuation used in programming languages

    upload_2017-5-10_14-17-3.png
     
  2. Jimmy

    Jimmy Well-Known Member

    1,706
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    11:24 AM
    1.17.x
    MariaDB 10.3.x
  3. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Yeah use that online generator whenever i need to for stuff :)
     
  4. noly

    noly Member

    98
    16
    8
    Jul 24, 2017
    Germany
    Ratings:
    +28
    Local Time:
    4:24 PM
    1.18.x
    10.2.x
    Hmmm...strange...

    Code (Text):
    cd /usr/local/src/centminmod/addons/
    
    ./mysqladmin_shell.sh createuserdb xdb1 xdbuser1 xdbpass1

    creates a db named "createuserdb" instead of xdb1.

    Syntax or Bug?
     
    Last edited: Jul 30, 2017
  5. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    could be a bug, will look into it :)
     
  6. noly

    noly Member

    98
    16
    8
    Jul 24, 2017
    Germany
    Ratings:
    +28
    Local Time:
    4:24 PM
    1.18.x
    10.2.x
    Oh....i just recognized that my fresh phpmyadmin throws these messages...

    Code:
    The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.
    Or alternately go to 'Operations' tab of any database to set it up there.
    Code:
    Configuration of pmadb... not OK
    General relation features Disabled
     
    Last edited: Jul 30, 2017
  7. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    bug fixed in 123.09beta01 Beta Branch - fix addons/mysqladmin_shell.sh createuserdb option bug

    Code (Text):
    ./mysqladmin_shell.sh createuserdb xdb2 xdbuser2 xdbpass2
    --------------------------------------------------------------
    Basic MySQL Admin - create mysql user & databases
    --------------------------------------------------------------
    --------------------------------------------------------------
    
    Grants for xdbuser2@localhost
    GRANT USAGE ON *.* TO 'xdbuser2'@'localhost' IDENTIFIED BY PASSWORD '*3399103BC71C868431660AC2C4B2128D4002C5BB'
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON `xdb2`.* TO 'xdbuser2'@'localhost'
    
    Ok: MySQL user: xdbuser2 MySQL database: xdb2 created successfully
    
     
  8. noly

    noly Member

    98
    16
    8
    Jul 24, 2017
    Germany
    Ratings:
    +28
    Local Time:
    4:24 PM
    1.18.x
    10.2.x
    Thank you @eva2000 .

    Can't really tell you how to exactly reproduce it but during testing sometimes it worked flawless and sometimes i got an error when adding, deleting and adding a user again:

    Code (Text):
    --------------------------------------------------------------
    Basic MySQL Admin - create mysql user & databases
    --------------------------------------------------------------
    --------------------------------------------------------------
    
    ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'dbuser'@'localhost'
    
    Error: command was unsuccessful


    Here is a possible solution:
    ERROR 1396 (HY000): Operation CREATE USER failed for 'jack'@'localhost'
     
  9. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yes FLUSH PRIVILEGES is needed after deleting. Known procedure :)

    mysqladmin_shell.sh already does this
     
  10. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Reminder when creating database names make sure you do not use hyphens on invalid identifier characters in the names. For database names and tables, hyphens aren't really a valid mysql identifiers allowed MySQL :: MySQL 5.6 Reference Manual :: 9.2 Schema Object Names. Underscores yes, hyphens no.
     
  11. rdan

    rdan Well-Known Member

    4,990
    1,190
    113
    May 25, 2014
    Ratings:
    +1,812
    Local Time:
    11:24 PM
    Mainline
    10.2
    No feature for?
    • List Database
    • List Users
    • Delete Database
     
  12. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    none right now those some of it's available in my own mysqlmymonlite.sh script at mysqlmymonlite.sh Addon

    Code (Text):
    /root/tools/mysqlmymonlite.sh dblist
    
    mysql performance_schema
    

    and dbbackup.sh MariaDB - dbbackup.sh - quick mysql database backups for Centmin Mod stack
    Code (Text):
    /root/tools/dbbackup.sh dblist
    +--------------------+
    | Database           |
    +--------------------+
    | db1                |
    | db2                |
    | db3                |
    | db4                |
    | db5                |
    | db6                |
    | information_schema |
    | mysql              |
    | performance_schema |
    +--------------------+
    

    Code (Text):
    /root/tools/dbbackup.sh dbinfo 
                             db1 [idx: 0.00 MB data: 0.00 MB]
                             db2 [idx: 0.00 MB data: 0.00 MB]
                             db3 [idx: 0.08 MB data: 0.11 MB]
                             db4 [idx: 1.72 MB data: 7.52 MB]
                             db5 [idx: 0.25 MB data: 1.52 MB]
                             db6 [idx: 0.78 MB data: 5.52 MB]
      verylongdbnameexampletested [idx: 0.00 MB data: 0.00 MB]
    
     
  13. yunos

    yunos Member

    107
    3
    18
    Aug 8, 2015
    Ratings:
    +12
    Local Time:
    4:24 PM
    1.8.0
    could this be added on centmin.sh menu option once users install addon on their own? would allow for much easier access
    like have a menu showing addons and the submenu can list all the addons users have installed
     
  14. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,313
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,995
    Local Time:
    1:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    that could be a possibility eventually :)