I have a account Admin but not super Admin so i cant delet organisation.
So haw to create a Super Admin account ?
thank you very much
Only a super admin can make another account super admin
thankâs fr the replay
But i dont have this first Super Admin accountâŚ
And i canât connecte with
Id : admin Password : admin
maybe I changed it and forgot the password
Can i configurate it ?
Yes, from the docs:
http://docs.grafana.org/administration/cli/#reset-admin-password
thankâs daniellee
As I answered in other post:
This is definitely a Grafana bug, once you created a normal admin user, you could delete the super admin user. Itâs easy to get it back, though.
Create a user named admin with email admin@localhost
then reset the password for it
bang! you get the super admin back
@ospider - I have seen your two posts about this. But if I no longer have access to backend how does one create this new user??
well, what do you mean by backend? you need a normal admin account to add another user.
@ospider Sorry, I assumed my issue was similar to that of the OP. Maybe not.
I had everything up and running, logging in with admin:admin. For security reasons I then decided to create another user in the Grafana backend then delete âadminâ. I gave it a username, email, password, checked the âGrafana adminâ box and gave it rights to the Dashboards. I logged out (of admin), tried the new one, all looked wellâŚ
I then proceeded to delete the admin accountâŚ(via the web GUI.)
After that the new account wouldnât workâŚkeeps giving me an âUnauthorizedâ error. I checked the SQLite DB, admin no longer exists, but the new one doesâŚwhich makes sense.
@ospider saying everything above, I decided to remove grafana in its entirety and start from scratch. I am nearly back up and running. A bit of a pain to recreate my dashboards. I also want to note that I am now on a much newer instance of grafana and maybe similar issue has been rectified.
I find it odd that I was able to remove an admin account if its clearly required.
**oops I think I posted on the wrong oneâŚ
I have faced this problem in a server I manage, the super-admin user had been deleted and my regular-admin user did not have access to managing organizations, for instance. This is what I did to give that regular-admin user super-admin powers (in parenthesis what I specifically did, your experience might be different):
- stop grafana (âdocker stop grafanaâ)
- make sure you have sqlite3 (âsudo apt install sqlite3â)
- open the grafana.db database (âsudo sqlite3 /data/grafana/grafana.dbâ)
- update is_admin field for that user (âupdate user set is_admin=1 where login=âxoseâ;â)
- exit sqlite3 and restart grafana (Ctrl+D, âdocker start grafanaâ)
- enjoy your superadmin powers
So I made the mistake of deleting the only super admin account on the server. To generate a new account I used the following commands (debian):
(Run as root)
First install the sqlite3 binaries (so that we can use sqlite3 console from the shell window)
apt install sqlite3
Once installed, enter the following command to access the grafana database:
sqlite3 /var/lib/grafana/grafana.db
Within the sqlite console, copy and paste the below code:
INSERT INTO user (id, version, login, email, name, org_id, is_admin, created, updated) VALUES(1, 0, 'admin', 'admin@localhost', 'Admin', 1, 1, datetime('now'), datetime('now'));
Press Ctrl + D to exit sqlite console.
Finally run:
grafana-cli admin reset-admin-password admin
Thank you. It worked!
Thanks @jordanharvey2000
Somehow it worked for me.
This problem occurred when super admin credentials got deleted when that user left organization.
Best practice is that super admin previlages has to be transfer to someone with admin role.
in such cases use below command
grafana-cli --homepath â/usr/share/grafanaâ admin reset-admin-password
if this not works or it may give error that could not read user from database so in that situation only we have to run below command. Make sure you have stopped Grafana server by
âsystemctl stop grafana-serverâ
then with root or sudo access use
âsqlite3 /var/lib/grafana/grafana.dbâ
then paste below command
INSERT INTO user (id, version, login, email, name, org_id, is_admin, created, updated) VALUES(1, 0, âadminâ, âadmin@localhostâ, âAdminâ, 1, 1, datetime(ânowâ), datetime(ânowâ));
then press ctrl + d to exit from sqlite3
then try to reset password by
grafana-cli --homepath â/usr/share/grafanaâ admin reset-admin-password
it will show Admin password changed successfully
then restart grafana server by
systemctl restart grafana-server
Now check on your browser âcommunity.grafana.comâ
use user as admin & password you set
make sure that while doing database changes grafana server has to be stopped else it may not reflect changes in some cases