grafana

Grafana-cli admin reset-admin-password access is denied


I'm running grafana locally on my windows 10 computer using the grafana-8.0.2.windows-amd64 installer.

I'm having issues resetting my password - username: admin password: admin doesn't work and I don't remember what I set it to. I've navigated to the /GrafanaLabs/grafana/bin/ folder in the command prompt and run the command: grafana-cli admin reset-admin-password 'admin' which returns ←[31mError←[0m: ←[31m✗←[0m failed to load configuration: failed to initialize file handler: open C:\Program Files\GrafanaLabs\grafana\data\log\grafana.log: Access is denied.

I've read so many potential solutions and tried the SQLite one referenced here - https://community.grafana.com/t/how-do-i-reset-admin-password/23/2 and while this doesn't give me an error message, it does not allow me to log in even after restarting the Grafana in "Services" through the OS.


Solution

  • Very simply, you need to run the command prompt as an administrator. The above instructions will work as is but the password will literally be 'admin' rather than admin. Use double quotes if you wish to have spaces in your password as shown below.

    grafana-cli admin reset-admin-password "admin password"