whoami
sudo -i
yum install postgresql-server
service postgresql initdb
service postgresql start
sudo -u postgres psql
create user "ec2-user" createdb;
create database "ec2-user";
\q
host all ec2-user 127.0.0.1/0 md5
# host all all 127.0.0.1/0 trust
service postgresql restart
# add a password for ec2-user
alert role "ec2-user" WITH PASSWORD 'some_password';
const Sequelize = require('sequelize');
const conn = new Sequelize({ dialect: 'postgres', user: 'ec2-user', password: 'pw', database: 'acme_db', host: 'localhost' });
const User = conn.define('user', {}); conn.sync({ force: true});
CREATE DATABASE foobar;