Відмінності між версіями «PostgreSQL»
Перейти до навігації
Перейти до пошуку
(Created page with '== Встановлення == # yum install postgresql postgresql-server # chkconfig postgresql on # service postgresql start -A RH-Firewall-1-INPUT -m state --state NEW -...') |
|||
| Рядок 4: | Рядок 4: | ||
# service postgresql start | # service postgresql start | ||
| + | |||
| + | == Встановлення нової версії == | ||
| + | добавляємо репозиторій | ||
| + | |||
| + | c5-testing.repo: | ||
| + | [c5-testing] | ||
| + | name=CentOS-5 Testing. | ||
| + | baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/ | ||
| + | '''enabled=0''' | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing | ||
| + | |||
| + | yum --disablerepo=\* --enablerepo=c5-testing install postgresql-server postgresql | ||
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT | -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT | ||
| Рядок 26: | Рядок 39: | ||
$ su - andrew | $ su - andrew | ||
$ psql -d mydb -U andrew | $ psql -d mydb -U andrew | ||
| + | |||
| + | |||
| + | == Віддалений доступ == | ||
Версія за 22:13, 10 квітня 2010
Зміст
Встановлення
# yum install postgresql postgresql-server # chkconfig postgresql on # service postgresql start
Встановлення нової версії
добавляємо репозиторій
c5-testing.repo:
[c5-testing] name=CentOS-5 Testing. baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/ enabled=0 gpgcheck=1 gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
yum --disablerepo=\* --enablerepo=c5-testing install postgresql-server postgresql
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
Вхід у консоль
# su - postgres $ psql template1
or
$ psql -d template1 -U postgres
Створення користувача
# adduser andrew # passwd andrew # su - postgres $ psql template1 template1=# CREATE USER andrew WITH PASSWORD 'myPassword'; template1=# CREATE DATABASE mydb; template1=# GRANT ALL PRIVILEGES ON DATABASE mydbto andrew; template1=# \q
тестуваня
$ su - andrew $ psql -d mydb -U andrew