How do I grant Admin Rights to an existing user using the CLI


I accidentally removed my Admin user from the Admin and Default groups. I need to grant Admin rights to the user again using the CLI because I can NOT do it in the UI. I’ve tried using this suggestion ./ users grant_admin {email} and I am getting an error. Any help would be greatly appreciated.



There are two options:

  1. Create a new admin user (using the CLI).
  2. Use psql to add the user to the groups again. This will be something like:
$ sudo sudo -u redash psql  # the double sudo is not a mistake, you will probably need it on a GCP instance.
> select id from groups; # note the resulting group ids -> probably 1 & 2.
> update users set groups = '{1,2}' where id = ...; # change 1,2 to the correct group IDs.


Worked perfectly. Thank you!