How to change APG or MySQL database password
search cancel

How to change APG or MySQL database password

book

Article ID: 315883

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms: Need to change the APG or MySQL database password.

 

Steps to change the APG or MySQL database password.



Environment

Watch4Net/M&R:7.x

Resolution

  • How to change APG database password for Watch4net or ViPR SRM.
  1. To change the Watch4net APG or MySQL database password, do the following:
     
1. First, stop these services to make sure nothing accesses the database:
 
Tomcat  (/opt/APG/bin/manage-modules.sh service stop tomcat)
Backend (/opt/APG/bin/manage-modules.sh service stop backend)
Task-Scheduler (/opt/APG/bin/manage-modules.sh service stop task-scheduler) to prevent database optimization tasks from running.
 
2. Connect to either MySQL or the APG Datastore as root with these commands:
 
MySQL:
Linux : /opt/APG/bin/mysql-client.sh

APG Datastore:
Linux : /opt/APG/bin/datastore-client.sh

 
3. Once connected as root, run the following commands:
 
update user set password=PASSWORD("NEW_PASSWORD") where User='apg';
update user set password=PASSWORD("NEW_PASSWORD") where User='root';
Replace the string "NEW_PASSWORD" with your own password.
 
4. Run the following commands to update the permissions:
 
GRANT ALL PRIVILEGES ON *.* TO 'apg'@'localhost' IDENTIFIED BY 'NEW_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'apg'@'server.domain.net' IDENTIFIED BY 'NEW_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'apg'@'<IP Address>' IDENTIFIED BY 'NEW_PASSWORD';
FLUSH PRIVILEGES;

Replace either the FQDN or the IP address to match all those used in your network.
 
5. After the password has been changed, you have to update APG's configuration files. Here's a list of the modules that connect to the databases, and the files to update.
 
Frontend Server / Tomcat

/opt/APG/Web-Servers/Tomcat/Default/conf/server.xml
/opt/APG/Tools/Frontend-Search/Default/conf/frontend-search.xml
/opt/APG/Tools/Frontend-Report-Generator/Default/conf/report-generation-config.xml
/opt/APG/Tools/Administration-Tool/Default/conf/master-accessor-service-conf.xml
/opt/APG/Tools/WhatIf-Scenario-CLI/Default/conf/whatif-scenario-cli-conf.xml

To allow for encrypted passwords in the Front End edit the 

/opt/APG/Web-Servers/Tomcat/Default/conf/module.properties and add this line:
javax.sql.DataSource.Factory=com.watch4net.apg.v2.gui.tomcat.W4NDataSourceFactory


Backend Server

/opt/APG/Backends/APG-Backend/Default/conf/mysql.xml
/opt/APG/Tools/Topology/Default/conf/topology-refresh-config.xml
/opt/APG/Tools/MySQL-Maintenance-Tool/Default/conf/mysql-root-apg.xml
/opt/APG/Tools/MySQL-Maintenance-Tool/Default/conf/mysql-root-mysql.xml
/opt/APG/Tools/MySQL-Maintenance-Tool/Default/conf/mysql.xml
/opt/APG/Tools/Administration-Tool/Default/conf/master-accessor-service-conf.xml
 
6.  Restart the Watch4Net/MnR Application.