Sarathlal N

Create database, user & allow access - PostgreSQL

Creating user

sudo -u postgres createuser <username>	 

Creating Database

sudo -u postgres createdb <dbname>	 

Access PostgreSQL command-line interface

sudo -u postgres psql	 

Giving the user a password

alter user <username> with encrypted password '<password>';	 

Granting privileges on database

psql=# grant all privileges on database <dbname> to <username>;

Recent Posts

  1. Action hooks that trigger on, before or after add, update or delete actions of option - WordPress
  2. Get all variations of a variable product - WooCommerce
  3. Generate random string - Python
  4. Split domain from an email address - Python
  5. Get upcoming N days - PHP

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.