Grafana重置admin密码

@lianst  August 12, 2019

查找grafana.db的路径

1.通过配置文件查找

vim /etc/grafana/grafana.ini
 12 #################################### Paths ####################################
 13 [paths]
 14 # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
 15 ;data = /var/lib/grafana
 16 

2.find命令查找

[[email protected] ~]# find / -name "grafana.db"
/var/lib/grafana/grafana.db

打开数据库

[[email protected] ~]# sqlite3 /var/lib/grafana/grafana.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
alert                     dashboard_version         session                 
alert_notification        data_source               star                    
alert_notification_state  login_attempt             tag                     
annotation                migration_log             team                    
annotation_tag            org                       team_member             
api_key                   org_user                  temp_user               
cache_data                playlist                  test_data               
dashboard                 playlist_item             user                    
dashboard_acl             plugin_setting            user_auth               
dashboard_provisioning    preferences               user_auth_token         
dashboard_snapshot        quota                   
dashboard_tag             server_lock   

修改user表的Admin用户密码

update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';

评论已关闭