Відмінності між версіями «PostgreSQL»

Матеріал з Wiki Welard
Перейти до навігації Перейти до пошуку
Рядок 3: Рядок 3:
 
  # chkconfig postgresql on
 
  # chkconfig postgresql on
 
  # service postgresql start
 
  # service postgresql start
−
 
  
 
== Встановлення нової версії ==
 
== Встановлення нової версії ==
−
добавляємо репозиторій
+
добавляємо репозиторій '''c5-testing.repo''':
−
 
 
−
c5-testing.repo:
 
 
  [c5-testing]
 
  [c5-testing]
 
  name=CentOS-5 Testing.
 
  name=CentOS-5 Testing.

Версія за 22:14, 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


Віддалений доступ