Admin password reset


I lost my admin password, I tried to reset it as shown in FAQ

sudo grafana-cli --homepath “/usr/share/grafana/” admin reset-admin-password newpass

returns : Incorrect Usage. flag provided but not defined: -homepath

could you help me


1 Like

Copy/paste the command you entered and the result please. Hide the password obviously. Put it between lines containing three backticks so the format is not mangled by the forum s/w.

Use the following command, the password will be admin, just run the command and restart the grafana service, hope this helps.

Command: grafana-cli admin reset-admin-password admin

$ sudo grafana-cli admin reset-admin-password admin

Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath

doesn’t work :frowning:

any idea ? :slight_smile: thanks

This might help

thanks a lot I tried with sqlite method, it works !!

I use the root user on centos, and i do it on the folder it comes as default, i dont change any directories, and that worked for me 2 times already, but its good that you finally figured it out, sorry for the late response

For everyone that came here by a google search just like I did.
The problem is the order of the command line arguments.

When you use the command like described in the documentation, it failes:

grafana-cli --homepath "c:\Program Files\grafana" admin reset-admin-password mynewpassword
Incorrect Usage. flag provided but not defined: -homepath

But by switching the command line arguments, it works:

grafana-cli admin reset-admin-password --homepath "c:\Program Files\grafana" mynewpassword
t=2019-08-14T11:29:47+0200 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2019-08-14T11:29:47+0200 lvl=info msg="Starting DB migration" logger=migrator

Admin password changed successfully ✔

Grafana Version in use 6.1.3 on Windows 10 Pro (1809).