PostGreSQL: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 1: | Zeile 1: | ||
= Installation = | = Debian= | ||
apt-get install postgresql-9.5 pgadmin3 | == Installation == | ||
<pre>apt-get install postgresql-9.5 pgadmin3 | |||
oder | |||
yum install postgresql-server postgresql-contrib | |||
</pre> | |||
== Ohne Admin-Passwort arbeiten (z.B. temporär) == | == Ohne Admin-Passwort arbeiten (z.B. temporär) == | ||
Zeile 6: | Zeile 10: | ||
** host all all 127.0.0.1/32 trust | ** host all all 127.0.0.1/32 trust | ||
** host all all ::1/128 trust | ** host all all ::1/128 trust | ||
= Centos7: = | |||
== Install == | |||
<pre>yum install postgresql-server postgresql-contrib | |||
</pre> | |||
== Passwort-Authentifizierung erlauben: == | |||
vi /var/lib/pgsql/data/pg_hba.conf | |||
# change | |||
host all all 127.0.0.1/32 ident | |||
host all all ::1/128 ident | |||
#to | |||
host all all 127.0.0.1/32 md5 | |||
host all all ::1/128 md5 | |||
systemctl restart postgresql | |||
</pre> | |||
== Rolle einrichten == | |||
<pre>sudo -u postgres -i | |||
createuser --interactive | |||
# z.B. hm einrichten | |||
</pre> | |||
== DB erzeugen == | |||
* als User hm: | |||
<pre>createdb sale | |||
</pre> | |||
== Als | |||
= Administration = | = Administration = |
Version vom 15. Februar 2017, 21:10 Uhr
Debian
Installation
apt-get install postgresql-9.5 pgadmin3 oder yum install postgresql-server postgresql-contrib
Ohne Admin-Passwort arbeiten (z.B. temporär)
- /etc/postgresql/9.5/main/pg_hba.conf
- host all all 127.0.0.1/32 trust
- host all all ::1/128 trust
Centos7:
Install
yum install postgresql-server postgresql-contrib
Passwort-Authentifizierung erlauben:
vi /var/lib/pgsql/data/pg_hba.conf
- change
host all all 127.0.0.1/32 ident host all all ::1/128 ident
- to
host all all 127.0.0.1/32 md5 host all all ::1/128 md5
systemctl restart postgresql
Rolle einrichten
sudo -u postgres -i createuser --interactive # z.B. hm einrichten
DB erzeugen
- als User hm:
createdb sale
== Als
Administration
Benutzer anlegen
- pgadmin3 aufrufen
- Login-Rollen: neue Rolle eintragen
- SQL:
- CREATE ROLE jonny LOGIN ENCRYPTED PASSWORD 'md582dfb88f80303e0d0e2ffdbdc9e82b64' SUPERUSER INHERIT CREATEDB CREATEROLE NOREPLICATION;