grafana重置admin密码

已知admin密码修改新密码

API 接口

1
2
3
4
5
curl -X PUT -H "Content-Type: application/json" -d '{
"oldPassword": "admin",
"newPassword": "newpass",
"confirmNew": "newpass"
}' http://admin:admin@<your_grafana_host>:3000/api/user/password

ui界面

直接进界面修改

忘记admin密码重置密码

命令行

1
grafana-cli admin reset-admin-password ...

If running the command returns this error:

Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath

then there are two flags that can be used to set homepath and the config file path.

1
grafana-cli --homepath "/usr/share/grafana" admin reset-admin-password newpass

修改数据库

1
update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
Donate