管理员密码忘记是一个头疼的事情
部署完了Grafana
之后就一直在看着,今天想改动一点东西发现密码都不对了.
查询baidu无果
问度娘方法,度娘没有相关资料啊
查看官方文档
找到救命稻草了,官方有说明的嘛. reset-admin-password
$ sudo grafana-cli admin reset-admin-password admin
INFO[07-26|11:01:44] Initializing DB logger=sqlstore dbtype=sqlite3
INFO[07-26|11:01:44] Starting DB migration logger=migrator
INFO[07-26|11:01:44] Executing migration logger=migrator id="copy data account to org"
INFO[07-26|11:01:44] Skipping migration condition not fulfilled logger=migrator id="copy data account to org"
INFO[07-26|11:01:44] Executing migration logger=migrator id="copy data account_user to org_user"
INFO[07-26|11:01:44] Skipping migration condition not fulfilled logger=migrator id="copy data account_user to org_user"
Admin password changed successfully ✔
$ sudo service grafana-server restart
打开登录界面,依然登录不进去 抓狂的我换了很多遍姿势,还是不行啊
换英文,用google
查询了下grafana reset admin password not working
在github
上终于找到友军了
Reset Admin pass #1815
解决办法,改库
改库我也知道啊,不过我的是用的sqllite
,不是mysql
,不然早去库里看了,茫然的很,还好很简单.
- mysql
update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6',
salt = 'F3FAxVm33R' where login = 'admin'
- sqllite
$ sudo sqlite3 /var/lib/grafana/grafana.db
sqlite> update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6',
salt = 'F3FAxVm33R' where login = 'admin';
sqlite> .exit
再次登录,已经重置了