• Home
  • Postgresql
  • How to create new database and users in postgresql (Linux)

How to create new database and users in postgresql (Linux)

linkaiyi
Follow

change user password in linux; e.g. for user postgres

To change a password on behalf of a user, first sign on or “su” to the “root” account. Then type, ``passwd user’’

Change the user to postgres :

su - postgres

Create User for Postgres

$ createuser testuser

Create Database

$ createdb testdb

Acces the postgres Shell

psql ( enter the password for postgressql)

Provide the privileges to the postgres user

$ alter user testuser with encrypted password 'qwerty';
$ grant all privileges on database testdb to testuser;
Object has 0 attachments

Was this article helpful?

This article is viewed 61 times!

Recent Viewed Articles

0 Comments

Leave a Comment

Support