Changing MariaDB passwords

Use this procedure to change the passwords of the MariaDB databases for event and model data.
To perform this procedure, the MariaDB child service of Zenoss Core must be running.
  1. Log in to the Control Center master host as root, or as a user with superuser privileges.
  2. Log in to the Docker container of the MariaDB service as zenoss.
    serviced service attach mariadb su - zenoss
  3. Change the passwords.
    1. Start an interactive session.
      export TERM=dumb; mysql -u root
    2. Access the administration database.
      USE mysql
    3. Set the password of the root user.
      Replace New-Password with a new password:
      SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('New-Password');
      SET PASSWORD FOR 'root'@'localhost' = PASSWORD('New-Password');
      Record the password for use in a subsequent step.
    4. Update the password of the zenoss user.
      Replace New-Password with a new password:
      SET PASSWORD FOR 'zenoss'@'127.0.0.1' = PASSWORD('New-Password');
      SET PASSWORD FOR 'zenoss'@'%' = PASSWORD('New-Password');
      Record the password for use in a subsequent step.
    5. Exit the interactive session.
      QUIT
      The MariaDB server loads the grant tables into memory immediately when account management statements like SET PASSWORD are used, so the FLUSH PRIVILEGES statement is not necessary.
  4. Log in to the Control Center browser interface.
  5. In the Applications table, click Zenoss.core.
  6. In the application title line, click Edit Variables.
    Initially, the application title line appears immediately below the Control Center banner at the top of the page. When you scroll down the page, the application title line persists at the top of the page.
    Figure 1. Edit Variables dialog
  7. Update the passwords of the event and model databases.
    1. In the Edit Variables dialog, locate the global.conf.zep-password and global.conf.zodb-password variables.
      These variables use the password of the zenoss user.
    2. Replace their values with the new password specified previously.
    3. Locate the global.conf.zep-admin-password and global.conf.zodb-admin-password variables.
      These variables use the password of the root user.
    4. Replace their values with the new password specified previously.
    5. At the bottom of the Edit Variables dialog, click Save Changes.
  8. Restart Zenoss Core.
    1. Scroll down to the Services table, and then locate the MariaDB service.
    2. In the application title line, click the Restart control.