基本原理是grafana中封装了sqlite数据库,admin密码在sqlite数据库中
,直接更新sqlite中用户的密码就行
[root@VM-4-10-centos ~]# ps -ef|grep grafa
tidb 5047 1 1 16:45 ? 00:00:08 bin/bin/grafana-server --homepath=/tidb-deploy/grafana-3000/bin --config=/tidb-deploy/grafana-3000/conf/grafana.ini
root 7993 29254 0 16:53 pts/4 00:00:00 grep --color=auto grafa
[root@VM-4-10-centos ~]#
[root@VM-4-10-centos ~]#
[root@VM-4-10-centos ~]#
[root@VM-4-10-centos ~]# cd /tidb-deploy/grafana-3000
[root@VM-4-10-centos grafana-3000]#
[root@VM-4-10-centos grafana-3000]# cd data
[root@VM-4-10-centos data]# ll
total 5052
-rw-r----- 1 tidb tidb 5165056 Mar 7 16:52 grafana.db
drwx------ 2 tidb tidb 4096 Mar 7 16:45 png
---登录sqlite数据库,并将密码改回为admin
[root@VM-4-10-centos data]# sqlite3 grafana.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
sqlite> .exit