myusername = the username you want to give access to the database
mypassword = the password you want to assign to the user
sudo -u postgres psql create database mydb; create user myusername with encrypted password 'mypassword'; grant all privileges on database mydb to myusername;
Done.