psql DBNAME USERNAME
# connect
sudo -u postgres psql -h localhost
# database
create database [name];
\l
\list
# desc tables
\d+ users
\dt
# switch database
\connect DBNAME
\c DBNAME
# import
psql databasename < data_base_dump
psql -h localhost -U username database_name < db.dump
#user & permission
create user diendannhatban with password 'password';
grant all privileges on database diendannhatban to diendannhatban;