- 找到grafana的数据文件grafana.db
find / -name "grafana.db" ps:默认的安装路径为/var/lib/grafana/grafana.db
- 进入数据库修改数据
#进入数据库 sqlite3 /var/lib/grafana/grafana.db #查看表 .tables #查看表中数据 select * from user; #更改密码为admin update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin'; #退出 .exit
- 重启grafana
systemctl stop grafana-server.service systemctl start grafana-server.service