At the command line, type the following command as the server’s root user: su – postgres.You can now run commands as the PostgreSQL superuser. … At the Enter name of role to add: prompt, type the user’s name.At the Enter password for new role: prompt, type a password for the user.
How do I get superuser privileges in PostgreSQL?
To create a new database superuser, use CREATE ROLE name SUPERUSER . You must do this as a role that is already a superuser. A role must be explicitly given permission to create databases (except for superusers, since those bypass all permission checks). To create such a role, use CREATE ROLE name CREATEDB .
How do I connect to PostgreSQL admin?
- i. On Linux: …
- ii. On Windows: …
- iii. On Mac: …
- Server [localhost]: This is the address for the server. …
- Database [postgres]: The name of the database with which you want to connect. …
- Port [5432]: …
- Username [postgres]: