Introduction

grafana reset-admin password is usually straightforward until the command runs against the wrong database path, wrong container filesystem, or wrong Grafana config. When that happens, the CLI appears to succeed but the login still fails because the password reset never touched the active user store.

Symptoms

  • grafana-cli admin reset-admin-password runs, but login still fails
  • The reset works in one environment but not inside Docker or Kubernetes
  • Grafana uses an external database while the CLI targets a local SQLite path
  • The admin user was renamed or disabled and the reset hits the wrong account

Common Causes

  • The CLI is using the wrong grafana.ini or home path
  • Grafana stores users in MySQL/PostgreSQL, but the reset command targeted SQLite defaults
  • The reset command ran inside the wrong container or pod
  • The active admin username is not the default admin

Step-by-Step Fix

  1. 1.Identify the active Grafana config and database backend
  2. 2.Check which config file and database the running service actually uses.
bash
ps -ef | grep grafana
grep -E \"type =|host =|name =\" /etc/grafana/grafana.ini
  1. 1.Run the reset against the same home and config path
  2. 2.The CLI needs the real Grafana home path and config file, not just the binary.
bash
grafana-cli --homepath /usr/share/grafana --config /etc/grafana/grafana.ini admin reset-admin-password NewStrongPassword123
  1. 1.If running in Docker or Kubernetes, execute inside the active container
  2. 2.Reset from the same runtime that owns the database connection and config.
bash
docker exec -it grafana grafana-cli admin reset-admin-password NewStrongPassword123
  1. 1.Verify which user is actually the admin
  2. 2.If the admin username changed, reset the right account in the active user store.

Prevention

  • Document the exact Grafana config path and database backend per environment
  • Keep secret rotation and emergency reset procedures tested
  • Avoid assuming every Grafana deployment still uses the default SQLite backend
  • Store the admin recovery workflow next to the deployment runbook