![]() sudo -u postgres createuser -interactiveĮither way, the script will prompt you with some choices and, based on your responses, execute the correct Postgres commands to create a user to your specifications.If, instead, you prefer to use sudo for each command without switching from your normal account, run: If you are logged in as the postgres account, you can create a new role by running the following command: This will log you directly into Postgres without the intermediary bash shell in between.Īgain, you can exit the interactive Postgres session by running the following: To return to your regular system user, run the exit command:Īnother way to connect to the Postgres prompt is to run the psql command as the postgres account directly with sudo: ![]() This will bring you back to the postgres Linux command prompt. To exit out of the PostgreSQL prompt, run the following: This will log you into the PostgreSQL prompt, and from here you are free to interact with the database management system right away. Then you can access the Postgres prompt by running: ![]() One way is to switch over to the postgres account on your server by running the following command: There are a few ways to utilize this account to access Postgres. The installation procedure created a user account called postgres that is associated with the default Postgres role. If a role exists within Postgres, a Unix/Linux username with the same name is able to sign in as that role. Upon installation, Postgres is set up to use ident authentication, meaning that it associates Postgres roles with a matching Unix/Linux system account. These are, in some ways, similar to regular Unix-style users and groups. Step 2 - Using PostgreSQL Roles and Databasesīy default, Postgres uses a concept called “roles” to handle authentication and authorization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |