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

    Jon Snow Active Member

    738
    150
    43
    Jun 30, 2017
    Ratings:
    +215
    Local Time:
    2:44 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Is there a way to test it?


    I tried it the other day and when entering it into src/config.php, it said error making a connection (I've updated the password multiple times with this and in the config file). I had to make a new database user to get it to connect.
     
  2. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:44 PM
    Nginx 1.25.x
    MariaDB 10.x
    The existing MySQL username would have to already have had permissions for accessing the Xenforo database name. Changing the MySQL username's password for a MySQL user that doesn't have permissions to access Xenforo database name, won't make that user work with Xenforo database name.

    What version of MariaDB MySQL are you using? 10.3 or 10.4+
     
  3. Jon Snow

    Jon Snow Active Member

    738
    150
    43
    Jun 30, 2017
    Ratings:
    +215
    Local Time:
    2:44 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    10.1.48

    The database, database user and password were made through the script. But I used the script again later to change the password of the database user. I then updated the new password in src/config.php but it wouldn't work.

    I re-created the database & database user, dumped the database, imported it into the new database and got it to work that way. But I couldn't get it to work by simply changing the password.
     
  4. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:44 PM
    Nginx 1.25.x
    MariaDB 10.x
    What version of Xenforo and what version of PHP?

    MariaDB 10.1.48 is very old so could be related. MariaDB 10.1 has been end of life for years now. Probably best to upgrade to 10.3 or 10.4 at least https://community.centminmod.com/threads/mariadb-10-1-upgrades-to-mariadb-10-2-10-3-and-10-4.17793/

    One thing is after you edited src/config.php did you restart PHP-FPM service? Centmin Mod Zend Opcache is configured with opcache.revalidate_freq = 180 seconds, so Zend Opcache PHP cache for performance reasons only checks PHP files for new changes after 180 seconds or if you restart PHP-FPM service to clear the cache. If you edited src/config.php and didn't restart PHP-FPM service within 180 seconds of src/config.php changes and tested Xenforo, it wouldn't have picked up the changes to MySQL user's password unless you waited >180 seconds or restarted PHP-FPM service.

    You can easily confirm if this is the case, by retrying a new password change + PHP-FPM service restart.
     
  5. Jon Snow

    Jon Snow Active Member

    738
    150
    43
    Jun 30, 2017
    Ratings:
    +215
    Local Time:
    2:44 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    XF 2.2.13 and PHP 7.4.33.
    I plan to once I get a chance.
    I restarted. I even flushed Redis just in case even tho it's not defined in the src/config.php file.

    This was a test site database user with the issue (the live site with Redis functions fine so it's not XF or PHP related).
     
  6. Itworx4me

    Itworx4me Active Member

    289
    27
    28
    Mar 14, 2017
    Ratings:
    +47
    Local Time:
    10:44 PM
    Nginx 1.25.X
    MariaDB 10.6.X
    @eva2000 How do I get this code to run from the command line?
    Code (Text):
    ./mysqladmin_shell.sh

    When running this code it says No such file or directory.

    Thanks,
    Itworx4me
     
  7. eva2000

    eva2000 Administrator Staff Member

    51,994
    11,976
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,473
    Local Time:
    3:44 PM
    Nginx 1.25.x
    MariaDB 10.x
    Full path for addon is /usr/local/src/centminmod /addons/mysqladmin_shell.sh