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

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 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,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    1:56 AM
  3. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 10.x
    Yeah use that online generator whenever i need to for stuff :)
     
  4. noly

    noly Member

    106
    16
    18
    Jul 24, 2017
    Germany
    Ratings:
    +28
    Local Time:
    7:56 AM
    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

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 10.x
    could be a bug, will look into it :)
     
  6. noly

    noly Member

    106
    16
    18
    Jul 24, 2017
    Germany
    Ratings:
    +28
    Local Time:
    7:56 AM
    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

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 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

    106
    16
    18
    Jul 24, 2017
    Germany
    Ratings:
    +28
    Local Time:
    7:56 AM
    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

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 10.x
    yes FLUSH PRIVILEGES is needed after deleting. Known procedure :)

    mysqladmin_shell.sh already does this
     
  10. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 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

    5,434
    1,395
    113
    May 25, 2014
    Ratings:
    +2,181
    Local Time:
    1:56 PM
    Mainline
    10.2
    No feature for?
    • List Database
    • List Users
    • Delete Database
     
  12. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 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

    129
    3
    18
    Aug 8, 2015
    Ratings:
    +16
    Local Time:
    7:56 AM
    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

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 10.x
    that could be a possibility eventually :)
     
  15. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 10.x
  16. happyhacking

    happyhacking Premium Member Premium Member

    111
    18
    18
    Apr 23, 2021
    Ratings:
    +61
    Local Time:
    12:56 AM
    1.22.0
    MariadDB 10.4.25
    I truly love this tool, but i would like to report a bug, when using the deluser option i changed my mind, left the user blank then used ctrl+c and after that i pressed enter and the following occurred:

    [/CODEB]
    ---------------------------------
    Delete MySQL username:
    ---------------------------------
    Enter MySQL username you want to delete: ^C

    Ok: Deleting ''@'localhost' was successful
    [/CODEB]

    Perhaps the script should force a non empty answer before executing the command. Just my opinion.
     
  17. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 10.x
    fixed in latest 130.00beta01 update :)

    new exit keyword
    Code (Text):
    ./mysqladmin_shell.sh deluser
    --------------------------------------------------------------
    Basic MySQL Admin - create mysql user & databases
    --------------------------------------------------------------
    --------------------------------------------------------------
    ---------------------------------
    Delete MySQL username:
    ---------------------------------
     Enter MySQL username you want to delete (type exit to abort): exit
     Aborted: No MySQL username entered
    

    empty input
    Code (Text):
    ./mysqladmin_shell.sh deluser
    --------------------------------------------------------------
    Basic MySQL Admin - create mysql user & databases 
    --------------------------------------------------------------
    --------------------------------------------------------------
    ---------------------------------
    Delete MySQL username:
    ---------------------------------
     Enter MySQL username you want to delete (type exit to abort): 
     Aborted: No MySQL username entered
    
     
  18. happyhacking

    happyhacking Premium Member Premium Member

    111
    18
    18
    Apr 23, 2021
    Ratings:
    +61
    Local Time:
    12:56 AM
    1.22.0
    MariadDB 10.4.25
    thank you so much that was fast !! btw do you think that deleted user: ''@'localhost' should exist ?
     
  19. Jon Snow

    Jon Snow Active Member

    738
    150
    43
    Jun 30, 2017
    Ratings:
    +215
    Local Time:
    2:56 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Does setpass still work?
     
  20. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:56 PM
    Nginx 1.25.x
    MariaDB 10.x
    setpass should work for all MySQL usernames except MySQL root user.