How to reset Grafana admin password using grafana-cli.


1. Identify the grafana pod and ssh into it:

[gjonas@master01]$ oc -n openmonitoring get pods
NAME               READY   STATUS      RESTARTS   AGE
grafana-6-r5dth    1/1     Running     0          6m45s

[gjonas@master01]$ oc rsh grafana-6-r5dth 
/usr/share/grafana $ 

2. Run the grafana-cli command to reset the admin password:

# In this example we reset the password back to the default value of "admin"
/usr/share/grafana $ grafana-cli admin reset-admin-password admin
INFO[08-04|16:13:53] Connecting to DB                         logger=sqlstore dbtype=sqlite3
INFO[08-04|16:13:53] Starting DB migration                    logger=migrator

Admin password changed successfully ✔

3. You will be prompted to set a new admin password after successfully logging into the Grafana GUI with the new password


The Grafana admin password will be reset and can be updated after logging into the Grafana GUI.