Forgot Password

I have forgot password to my grafana dashboard.

ACtually, I am logged-in in my own machine, but I have forgot the password and the team cannot log in. I have set my emaiI in my account and it says - FAILED TO SEND EMAIL when I press forgot password.

I have read the FAQ about resetting the password. How do I know that what database(sqlite,postgres) it is using ?

OR Is there any good way to reset the password via grafana-cli ?

Either fix your email settings so that you can send email or reset the admin password via the grafana-cli:

As a sidenote, just wondering why you couldn’t find it in the documentation? Is there something we can improve to make these features easier to find?

What FAQ is this?

Here is the FAQ I mentioned, How do i reset admin password?

I googled it and this was the first link I got, After reading this I thought that there is no solution for this, so thats why.

You must consider updating or deletinng that post.

Hey @daniellee,

I get this,

monitoring-server@monitoring-server:~$ sudo grafana-cli admin reset-admin-password newpass
Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath

After that I try this,

monitoring-server@monitoring-server:~$ sudo grafana-cli admin reset-admin-password --homepath '/usr/share/grafana' newpass
Incorrect Usage.

NAME:
   Grafana cli admin reset-admin-password - reset-admin-password <new password>

USAGE:
   Grafana cli admin reset-admin-password [arguments...]
flag provided but not defined: -homepath
monitoring-server@monitoring-server:~$ 

What do I do now ?

hey, got this,

This is what I did,

monitoring-server@monitoring-server:~$ cd /usr/share/grafana/
monitoring-server@monitoring-server:/usr/share/grafana$ sudo grafana-cli admin reset-admin-password newpass
INFO[07-14|13:24:09] Initializing DB                          logger=sqlstore dbtype=sqlite3
INFO[07-14|13:24:09] Starting DB migration                    logger=migrator
INFO[07-14|13:24:09] Executing migration                      logger=migrator id="create migration_log table"
INFO[07-14|13:24:09] Executing migration                      logger=migrator id="create user table"
INFO[07-14|13:24:09] Executing migration                      logger=migrator id="add unique index user.login"
.
.

.
.
INFO[07-14|13:28:58] Executing migration                      logger=migrator id="copy data account to org"
INFO[07-14|13:28:58] Skipping migration condition not fulfilled logger=migrator id="copy data account to org"
INFO[07-14|13:28:58] Executing migration                      logger=migrator id="copy data account_user to org_user"
INFO[07-14|13:28:58] Skipping migration condition not fulfilled logger=migrator id="copy data account_user to org_user"

Error: Could not read user from database. Error: User not found

NAME:
   Grafana cli admin reset-admin-password - reset-admin-password <new password>

USAGE:
   Grafana cli admin reset-admin-password [arguments...]

What is wrong now ?

Anyway, I reset my password via the email reset.

But you must tell that what was the issue here.

Hello there
I have the same problem.
I try to reset my admin password and end up with the error
Error: Could not read user from database. Error: User not found

Unfortunately I did not configure my email address, so I can not use the email reset.
How can I reset the admin password?
If possible I could also restart from scratch, but I do not know how to do this either.
I already purged grafana and installed it again, bat it seems that every configuration survived that somehow.

Every hint would be great.
Thank you in advance.

You mean you tried the admin password cli reset and got the “User not found” error?

http://docs.grafana.org/administration/cli/#reset-admin-password

How did you manage to delete your admin user? That should be very hard to do by accident.

The users are saved in the sqlite database so if you know any sql you could check the user table. (I use the DB Browser for sqlite but you can also use the sqlite command line tool).

Yes, I tried to reset with the command line in that link. I need to add the homepath and config parameter:
sudo grafana-cli admin reset-admin-password --homepath /usr/share/grafana --config "/etc/grafana/grafana.ini" admin

I did nothing else then this command. I have no clue how the admin user can be deleted.
It looks like it is the same problem like @luvpreet had.

I just checked the grafana.db using the DB browser!


The admin user is still there. I do not know where the error “User not found” comes from.

Regards

If you’ve got that far then you should be able to change the password this way instead:

I’ll check the cli command to make sure we did not break anything recently.

That did it! Thank you very much!