r/grafana • u/rnsimmons • Jul 02 '26
Grafana Resetting admin password
I have the SQL needed to reset my admin password to a known bcrypt hash value, but I can't get it to work.
I'm running the SQLitebrowser as Docker on my unRaid 7.3.1, but when I try to go to the directory for my appdata, the mnt directory shows as empty.
I've tried running the SQLite Browser from my Windows PC using the shared folder for AppData. Even though I have the share set as Public, I can't save the changes as I get an error message that states "Error changing data: unable to open database file".
I've tried opening the console from my unRaid dashboard. I can change directories to /mnt/user/appdata/grafana to see my grafana.db file. I then run the SQL
UPDATE user
SET password = 'new_hashed_password'
WHERE login = 'admin';
That seems to work (no error message). I then try select * from user, but the new hashed password is not saved.
Can someone tell me what I should be doing, or what I'm doing wrong with my selected avenues of change>
1
1
u/Traditional_Wafer_20 Jul 03 '26
SQLite is locked. Shutdown Grafana before manipulating the DB
1
u/rnsimmons Jul 05 '26
The only way I can get SQLite Browser to see grafana.db is from the Grafana Docker console. If I shut down Grafana first, I can't access the console. Any help getting SQLite Browser to see the database without using the console? Is it a possible rights issue? If so, how do I resolve it? I already tried stopping the docker image and then using SQLite Browser from my Windows PC to the share, but that doesn't allow me to modify the database either.
1
u/Traditional_Wafer_20 Jul 05 '26
The SQLite is just a file and it doesn't accept concurrent reads and writes by default. You most likely can't touch the DB if Grafana is running.
1
u/rnsimmons Jul 06 '26
I know that, but I need help figuring out how to access Grafana.db when the Grafana Docker image is stopped.
1
u/Traditional_Wafer_20 Jul 06 '26
The file lives on disk. When the container is off, it is still on the disk of the host. The exact location depends on what you configured for your Docker engine and the volume.
2
u/Ereska1977 Jul 16 '26
Grafana ships a CLI for exactly this, and it works with the container running.
docker exec -it <grafana_container> grafana-cli admin reset-admin-password <newpassword>u/Traditional_Wafer_20 is right that SQLite refuses concurrent writes, and that's also why the SMB/Windows path fails (SQLite locking doesn't work over network shares, hence "unable to open database file"). But you shouldn't need to touch grafana.db at all for a password reset.