How to create user and password in PostgreSQL database server

# createuser mypguser
# createdb -O mypguser mypgdatabase

or by connecting to postgresql server using psql – posgresql cli connect client equivalent of
“mysql” command line interface:

# su – postgres

$ psql

postgres=# CREATE USER mypguser WITH PASSWORD ‘mypguserpass’;
postgres=# CREATE DATABASE mypgdatabase OWNER mypguser;

Leave a Reply

Your email address will not be published. Required fields are marked *