- create user 'username'@'localhost' identified by 'user-password';
- create database dbname;
- grant all privileges on dbname.* to 'username'@'localhost';
- flush privileges;
- sudo --login --user postgres
- psql
- CREATE DATABASE dbname;
- CREATE USER username WITH PASSWORD 'user-password';
- GRANT ALL PRIVILEGES ON DATABASE dbname to username;