Update root mysql pass in multiple servers

Discussion in 'ISPConfig 3 Priority Support' started by Stelios, Aug 1, 2023.

  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi,

    I've got a couple of servers in a multi server setup that I want to change root password of mysql in all of them.
    Under mysql/user table it seems that for each there are multiple root access rights like:

    example: controlpanelserver, ip 10.0.0.1 (internal) 192.168.1.1 (suppose an external), localhost
    So under the mysql, user table there are 3 root accounts.
    In other servers like db, email etc there are:
    1 entry for localhost, one for its internal ip and one for its external IP plus one last that points back to the controlpanelserver IP, so 4 in total

    Is there a way to change all passwords quickly on all servers or I have to update each one manually on all (12 servers)?

    Also do I need to update any other file/setting related with ispconfig?

    Thanks in advance
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Not that I know of. They are separate accounts so each password must be changed.
     
  3. Stelios

    Stelios Active Member HowtoForge Supporter

    I did change all passwords and now the backup failed as root can't connect. Which file I have to update to include the new root pass?

    Thanks
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The file is /usr/local/ispconfig/server/lib/mysql_clientdb.conf
     
  5. Stelios

    Stelios Active Member HowtoForge Supporter

    Thanks till. Eventhough I got the proper password on that file on a specific server I'm keep getting:
    "Failed to make backup of database"
    Running the command from terminal works as the DB server is within the same machine in this case.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Run these two test commands:

    mysql -h localhost -u root -p
    mysql -h 127.0.0.1 -u root -p

    and enter the password when requested. The login must work with both commands.
     
  7. Stelios

    Stelios Active Member HowtoForge Supporter

    It is indeed working with both
     
  8. Stelios

    Stelios Active Member HowtoForge Supporter

    Forgot to mention that the backup directory is remotely but doesn't have any problems mount and unmount it.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Where exactly do you see this message? In ISPConfig? or when you do an update? or when you debug the backup plugin?
     
  10. Stelios

    Stelios Active Member HowtoForge Supporter

    Under error in monitoring. I've tried to get a manual backup as well and it fails too.
     
  11. Stelios

    Stelios Active Member HowtoForge Supporter

    Further to my post, if I run the command manually on terminal it takes the backup:

    mysqldump -u root -p******* c1mydb > c1mydb.sql

    The DB is very large, 3GB in case it matters.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Try:

    mysqldump -h localhost -u root -p******* c1mydb > c1mydb.sql

    and also

    mysqldump -h 127.0.0.1 -u root -p******* c1mydb > c1mydb.sql

    do both work? If they both work, then the issue is likely not related to the root password.
     
  13. Stelios

    Stelios Active Member HowtoForge Supporter

    It works with both fine; tried it and works also on the remote storage.
    It doesn't work through the interface of ISPConfig.
    The same happening on all servers that I upgraded to latest Debian 12. I got 15 servers total, finished the upgrade on 3 of them only and only on those is not working, all the rest are fine so it mus be something related with it.
     
  14. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are all hosts running the same ISPConfig version?
    If problem exists on hosts that were upgraded to Debian 12, but hosts still running Debian 11 work OK, the cause may be different DB version. Or is the new version somehow more strict with authentication or needs configuration tweaks?
     
    Last edited: Aug 14, 2023
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so it might be some kind of PHP 8.2 issue then or its related to the new MariaDB version. Have you tried using debug mode in ISPConfig to see if you get any additional errors on the shell when doing an instant backup?
     
  16. Stelios

    Stelios Active Member HowtoForge Supporter

    The version is the same on all servers, the latest of ISPConfig.
    Running from cli with debug it throws:

    mysqldump: Couldn't execute 'SHOW FUNCTION STATUS WHERE Db = 'c1mydb'': Cannot load from mysql.proc. The table is probably corrupted (1728)
    13.08.2023-20:14 - ERROR - Failed to make backup of database c1mydb, because mysqldump failed
    finished cron debug.

    There isn't any corruption on the table as manual works fine.
     
  17. Stelios

    Stelios Active Member HowtoForge Supporter

  18. Stelios

    Stelios Active Member HowtoForge Supporter

    Running the following command as root it works and now backups are working as expected:

    mysql_upgrade -u root -p

    Maybe you can add this to a patch to avoid more people having same problem.
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    As far as I can see from the link you posted, your MariaDB database was not properly upgraded when upgrading Debian, so there was no issue in ISPConfig, and there is nothing we could patch to avoid this as we will definitely not do automatic MariaDB table structure upgrades just out of the blue on systems that run ISPConfig.
     

Share This Page