Iām afraid I did something stupid .
On a newly installed Grafana instance I created a new user, granted it admin rights and finally deleted the default āadminā user.
Now, after some work on different panels I noticed, that Iām not allowed to install plugins and add new users or edit existing users. In another instance I found that there are two admin roles, āGrafana Adminā and admin on organization level. Probably I missed to grant one of these rights (not sure which one is missing in my case).
Is there a way to re-gain full admin rights?
I asked ChatGPT and it recommended to change the rights directly in the Grafana database (grafana.db). Feels a bit to adventurous to me.
Is there a better way?
Actually I do daily backups. But since one of the 1st things I do is to delete the default user with an easy to guess name (of course only after I have created another user with full admin rights - usually ), the backup will not help me.
I would have to pick a pretty old one that would be close to a fresh installation. I even think the 1st backup only happened after removing the āadminā user.
Anyhow, since I can export the dashboards and import them later, the best way is probably to start from the beginning.
Does anybody know if it is possible to file somewhere the suggestion that Grafana should not permit deleting of the last user with full admin rights?
[security]
# disable creation of admin user on first start of grafana
disable_initial_admin_creation = false
# default admin user, created on startup
admin_user = admin
# default admin password, can be changed before first start of grafana, or in profile settings
admin_password = admin
# default admin email, created on startup
admin_email = admin@localhost
and restart a Grafana.
It may (or may not, depends on implementation) recreate that admin user.
I decided to to start with a fresh installation. Since I run Grafana in a Docker container it was not that difficult. I had exported the existing dashboards and imported them again in the new instance. Some manual work was needed, but not that much. So it was OK and I didnāt try other ways. But still āthank youā for the advice!
Actually I have that setup. but in this case it didnāt help since my idea was not: āletās try to delete the only user with full admin rights and see what happensā. It was just a mistake .