Forgot VNA mysql password, need to reset it.
search cancel

Forgot VNA mysql password, need to reset it.

book

Article ID: 194436

calendar_today

Updated On:

Products

CA Virtual Network Assurance

Issue/Introduction

Forgot VNA mysql password, need to reset it

Environment

Dx NetOps Virtual Network Assurance any version

Cause

You should keep a list of your passwords.

MAKE SURE THAT THERE ARE PROPER BACKUPS BEFORE USING.

Resolution

This seemed to work in a LAB env:

1) Stop wildfly and mysql

  • systemctl stop wildfly
  • systemctl stop mysql

2) Reset mysql root password:

  • Start mysql in safe mode: /opt/CA/MySql/bin/mysqld_safe --skip-grant-tables &
  • Run the following command: /opt/CA/MySql/bin/mysql -uroot  (hit enter after running the command or it will appear to hang)
  • Run the following mysql commands
    • use mysql
    • FLUSH PRIVILEGES;
    • ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
    • exit;
  • /opt/CA/MySql/bin/mysqladmin -u root -p shutdown


3) Start mysql and make sure you can login with new password:

  • systemctl start mysql
  • /opt/CA/MySql/bin/mysql -uroot -pnewpassword
  • exit;

4) Generate new password string for use in standalone.xml:

  • java -cp /opt/CA/VNA/wildfly/modules/system/layers/base/org/picketbox/main/*:/opt/CA/VNA/wildfly/modules/system/layers/base/org/jboss/logging/main/* org.picketbox.datasource.security.SecureIdentityLoginModule newpassword
    • Result is: Encoded password: 386688ef4285511cff7045aaac1eb160

Note: Adjust the above commands for your installation path.

5) In /opt/CA/VNA/wildfly/standalone/configuration/standalone.xml find:

 <security-domain name="VNA_MySQL" cache-type="default">
                    <authentication>
                        <login-module code="SecureIdentity" flag="required">
                            <module-option name="username" value="root"/>
                            <module-option name="password" value="386688ef4285511cff7045aaac1eb160"/>
                            <module-option name="managedConnectionFactoryName" value="jboss.jca:service=LocalTxCM"/>
                        </login-module>
                    </authentication>
                </security-domain>
            </security-domains>

And use the value from step 4 as the password as noted above

6) Start wildfly:

  • systemctl start wildfly