Super Admin account

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 :wink:

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
2 Likes

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