Skip to content

Instantly share code, notes, and snippets.

@fagnersilva
Last active April 14, 2017 00:40
Show Gist options
  • Save fagnersilva/353991d28658c75bd7681b1ed289a7a6 to your computer and use it in GitHub Desktop.
Save fagnersilva/353991d28658c75bd7681b1ed289a7a6 to your computer and use it in GitHub Desktop.
install pgsql
apt-get install postgresql-9.6 postgresql-contrib-9.6 postgresql-client-9.6 libpq-dev
@fagnersilva
Copy link
Author

fagnersilva commented Jan 18, 2017

vim /etc/postgresql/9.4/main/postgresql.conf

listen_addresses = '0.0.0.0'

vim /etc/postgresql/9.4/main/pg_hba.conf

IPv4 local connections:
host all all 192.168.50.66/24 md5

@fagnersilva
Copy link
Author

fagnersilva commented Jan 18, 2017

su - postgres

psql -c "CREATE DATABASE pbx_config;"
psql -c "CREATE USER pbx WITH PASSWORD 'pbx_' CREATEDB CREATEUSER;"
psql -c "GRANT ALL PRIVILEGES ON DATABASE pbx_config to pbx;"

Drop db
su - postgres

dropdb db;
dropuser user;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment