Last active
July 15, 2018 16:54
-
-
Save mikesmullin/922827 to your computer and use it in GitHub Desktop.
Install PostgreSQL 8.4 on Ubuntu server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup db | |
sudo -i | |
apt-get install postgresql-8.4 | |
vim /etc/postgresql/8.4/main/pg_hba.conf | |
# change line 82 to read: | |
local all all md5 | |
# insert after line 84, replacing with your actual LAN ip outside the vm: | |
host all all 10.1.10.65/32 md5 | |
:wq | |
vim /etc/postgresql/8.4/main/postgresql.conf | |
# change line 59 to read: | |
listen_addresses = '*' | |
# change line 353 to read: | |
log_statement = 'all' | |
# uncomment lines 387-406 under AUTOVACUUM PARAMETERS section | |
:wq | |
service postgresql restart | |
# import create database | |
su postgres -c psql | |
CREATE ROLE mydatabase LOGIN | |
ENCRYPTED PASSWORD 'md58c72c10ab899f9b4237de13892336a5' | |
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE; | |
CREATE DATABASE mydatabase | |
WITH OWNER = myuser | |
ENCODING = 'UTF8' | |
LC_COLLATE = 'en_US.UTF-8' | |
LC_CTYPE = 'en_US.UTF-8' | |
CONNECTION LIMIT = -1 | |
TEMPLATE = template0; | |
ALTER ROLE postgres WITH PASSWORD 'mypassword'; | |
ALTER ROLE myuser CREATEDB; | |
CREATE DATABASE mytestdatabase; | |
ALTER DATABASE mytestdatabase OWNER TO myuser; | |
ALTER ROLE myuser superuser; | |
\q | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment