Skip to content

Instantly share code, notes, and snippets.

@mschae
Last active March 21, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mschae/4ab5c85b3b95a206349c519701978b40 to your computer and use it in GitHub Desktop.
Save mschae/4ab5c85b3b95a206349c519701978b40 to your computer and use it in GitHub Desktop.
Postgres Installieren

Zuerst führt installiert ihr postgres:

sudo apt-get update

sudo apt-get install postgresql

Dann startet ihr die Datenbank:

sudo services postgresql start

Dann müsst ihr ein Passwort für den Benuzter Postgres festlegen. Dafür öffnet ihr zunächst die Postgres Konsole und gibt danach ein paar Befehle ein:

sudo -u postgres psql, dann in der Konsole:

\password postgres legt ein Passwort fest, dann:

\q um die Konsole wieder zu beenden.

Dann müsst ihr noch das Format der Datenbank ändern. Dafür einfach folgende Zeilen komplett ins Terminal kopieren (ihr werden nach eurem Passwort gefragt was ihr oben festgelegt habt):

echo <<EOT | psql -U postgres -p 5432 -h localhost --password postgres  
  UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
  DROP DATABASE template1;
  CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
  UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
EOT

Denkt daran, die config/config.exs Datei zu bearbeiten und da postgres als Usern und das von euch festgelegt Passwort als Passwort einzutragen.

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