KB Article #70539

MySQL: How to recover the database password?

Problem

The password for the MySQL database was changed and then lost. Is there any way to recover it?


Resolution

Follow the below steps to recover the MySQL password.


1. Open the $FILEDRIVEHOME/conf/configuration.xml file with an editor.


2. Get one of the "Database" lines, for example:


<Database databaseType="mysql" host="127.0.0.1" jdbcDriver="com.mysql.jdbc.Driver" jdbcUrl="jdbc:mysql://${host}:${port}/st?user=${user}&password=${password}&characterEncoding=UTF-8&useTimezone=true&serverTimezone=UTC" password="{AES128}G0XTvn8hXRdcDnCgFaJ0jw==" port="33060" user="root">


3. Copy the string {AES128}G0XTvn8hXRdcDnCgFaJ0jw== for later use (this is an example string).


4. Use the aesdec tool as explained in KB 179327 to decode the hash and obtain the MySQL password in plain text.