合 grafana重置登录密码
2种修改方式
基于命令修改
基于修改数据库信息
一、基于命令修改
1.修改密码
1 2 | cd /home/gpadmin/soft/grafana grafana-cli admin reset-admin-password admin123 |
注意:admin123表示新密码;
2.重启服务
1 | systemctl restart grafana-server |
示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | [root@HF-Server80 grafana]# pwd /home/gpadmin/soft/grafana [root@HF-Server80 grafana]# [root@HF-Server80 grafana]# ll total 28 drwxr-xr-x 2 gpadmin gpadmin 96 Mar 18 2021 bin drwxr-xr-x 3 gpadmin gpadmin 107 Mar 18 2021 conf drwxrwxr-x 5 gpadmin gpadmin 61 Feb 7 18:09 data -rw-r--r-- 1 gpadmin gpadmin 11343 Mar 18 2021 LICENSE -rw-r--r-- 1 gpadmin gpadmin 108 Mar 18 2021 NOTICE.md drwxr-xr-x 4 gpadmin gpadmin 39 Mar 18 2021 plugins-bundled drwxr-xr-x 12 gpadmin gpadmin 155 Mar 18 2021 public -rw-r--r-- 1 gpadmin gpadmin 2799 Mar 18 2021 README.md drwxr-xr-x 2 gpadmin gpadmin 4096 Mar 18 2021 scripts -rw-r--r-- 1 gpadmin gpadmin 6 Mar 18 2021 VERSION [root@HF-Server80 grafana]# grafana-cli admin reset-admin-password admin123 -bash: grafana-cli: command not found [root@HF-Server80 grafana]# ./bin/grafana-cli admin reset-admin-password admin123 INFO[02-07|18:13:28] Connecting to DB logger=sqlstore dbtype=sqlite3 INFO[02-07|18:13:28] Starting DB migrations logger=migrator Admin password changed successfully ✔ |
二、基于修改数据库信息
1.查找数据库文件
find / -name "grafana.db"
2.访问数据库
sqlite3 /usr/local/grafana-7.3.6/data/grafana.db
3.查看表