How do i reset admin password?

I forgot the admin password is there a way to reset it?

1 Like

There is sadly not built in way to easily do this.

The below instructions should work for sqlite3. If you use MySQL or Postgres the SQL command should also work.

$ sudo sqlite3 /var/lib/grafana/grafana.db

sqlite> update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
sqlite> .exit

The above command sets the password for the username admin. If you changed the username for your admin user you need to modify the command accordingly. Since the passwords are hashed in the database it looks like the password is set to just random text.

8 Likes

Thanks! The cli command failed for me on 5.0.4 (even with extra params and cd’ing into the supposedly right dir) but this worked.

Thanks, This works @torkel !

I know that Security Questions, other account logins using Windows 7, and security mode can reset win 7 password, but I’m not sure if they can give the administrator password some help.

Thanks , it works @torkel :wink: You are awesome

This worked for me:

Thanks!
This worked for me. Same problem

Thanks @torkel it’s works

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.