grafana+mysql忘记admin密码解决方法

通过mysql修改admin的密码.
我之前注册了一个用户,所以我直接复制lvusyy这个用户的密码即可.

update user inner join (select password,salt,rands from user where user.login='lvusyy') as t  set user.password=t.password,user.salt=t.salt,user.rands=t.rands where user.login='admin';

update user inner join (select password,salt,rands from user where user.login='lvusyy') as t on user.login='admin'  set user.password=t.password,user.salt=t.salt,user.rands=t.rands;

这条语句可以设置admin的密码为admin

update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
sqlit3
sqlite3 /var/lib/grafana/grafana.db
#.tables查看有那些表
.tables
#select查看表里面的内容
select * from user;
#使用update更新密码  修改完成后密码是`admin`
update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
#修改完成后退出
.exit
posted @ 2019-09-05 20:31  lvusyy  阅读(602)  评论(0编辑  收藏  举报