How to reset the MariaDB password following a lost connection

Firstly, make sure the repository service has been stopped for the affected dashboard via Task Manager.

Open up a PowerShell console as Admin and cd into the DB bin folder for the affected dashboard using:

cd "*install location*:\Program Files\Dashboard\Dashboard\db\bin"

In the Bin folder, run the following command:

.\mysqld.exe --skip-grant-tables;

This will start the dashboard repository process so we can access the backend DB without needing the password.

Open up a separate PowerShell console as Admin, navigate to the dashboard location and run the following command to connect to the dashboard database:

.\mysql.exe -h 127.0.0.1 -P *dashboard repos port* -u root

Once connected, run the following commands:

FLUSH PRIVILEGES;

This will reload the grant tables in the MySQL database which will enable us to change the password without reloading or restarting MySQL service.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'BfGWi8T0uSVBkc5OZQ3DhhdR';

This will change the password for the root DB user to the default that is created on a standard install.

Make sure that there is a ‘pi_install.log’ within the db folder of the affected dashboard.

Finally, run the ‘Configuration Tool’ and start the dashboard services by clicking ‘Apply and Run’.