Can't able to create user admin

I am using cockroach db v2.1.4 and created some databases on that. Now i want to create username “admin” but i am not able to create admin user, it’s shows “pq: a role named admin already exists”, So i tried to set password for admin user but it’s showing that user admin is not exists. So can anyone help me to understand the logic behind it, Why i am not able to create admin user or password.

Also i am not able to set password for root user.

Hey @vishal,

The reason you are not able to set a password for the root user is that CockroachDB only allows the root user to authenticate with a client certificate and a key. This is because of the roots elevated priveledges.

You can read more about that here.

Additionally, CockroachDB also supports role creation which is a feature that allows you to elect certain priveledges for users.

Lastly, users and roles live in the same namespace, so you cannot have a user with the same name as a role. By default, only the root user and admin role exist.

This is the reason you are not able to create the user “admin”.

Let me know if you have any other questions!


Hey @mattvardi Thank you for the clarification. :+1::metal: