테스트: centos5.7
1. directory 생성
mkdir -p /usr/local/pgsql
2. user 생성
groupadd postgres
useradd -gpostgres -d /usr/local/pgsql postgres
3. postgres 다운로드
wget http://wwwmaster.postgresql.org/redir/408/f/source/v9.1.1/postgresql-9.1.1.tar.gz
tar xvzfp postgresql-9.1.1.tar.gz
chown -R postgres.postgres postgresql-9.1.1
4. postgres 설치
cd postgresql-9.1.1
yum -y install bison
flex 2.5.31 이상 필요함.
wget http://sourceforge.net/projects/flex/files/flex/flex-2.5.35/flex-2.5.35.tar.gz/download
tar xvzfp flex-2.5.35.tar.gz
cd flex-2.5.35
./configure;make ;make install
ln -sf /usr/local/bin/flex /usr/bin/flex
yum -y install readline-devel
yum -y install zlib-devel
./configure --prefix=/usr/local/pgsql --enable-nls=EUC_KR
make
make install
cd /usr/local/
chown -R postgres.postgres pgsql
su -l postgres -c "/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data"
* postgres 시작
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data 혹은
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
5. 라이브러리 추가
vi /etc/ld.so.conf
/usr/local/pgsql/lib
ldconfig
6. postgres 환경변수 설정
su - postgres
vi .bash_profile
----------------------------
PATH=$PATH:/usr/local/pgsql/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
PGLIB=/usr/local/pgsql/lib
PGDATA=/usr/local/pgsql/data
export PATH MANPATH PGLIB PGDATA
----------------------------
source .bash_profile
7. postmaster 데몬 띄우기
su - postgres
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
========================
dump data import하기
psql -e < db.out
data export 하기
pg_dumpall -z > db.out
db 권한 주기
su - postgres
createuser byoungguk ---> 권한 주고 싶은 계정
db 생성 및 테이블 생성
su - byoungguk
createdb test
psql test
byoungguk=> create table counter ( count int );
byoungguk=> insert into counter values ( 0 );
byoungguk=> \q
yum -y install php-pgsql
<?
$connect=pg_connect("dbname=test user=byoungguk");
$result=pg_exec($connect,"select * from counter");
$count_num = pg_result($result,0,"count");
if (!$count_num) {
$count_num++;
pg_exec($connect,"update counter set count=$count_num");
}
echo $count_num;
?>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5430 | 13년 전 | 1462 | ||
| 5429 |
phpman
|
13년 전 | 870 | |
| 5428 | 13년 전 | 1257 | ||
| 5427 |
phpman
|
13년 전 | 855 | |
| 5426 |
PHPㅡASP프로그래머
|
13년 전 | 1091 | |
| 5425 | 13년 전 | 800 | ||
| 5424 | 13년 전 | 743 | ||
| 5423 | 13년 전 | 747 | ||
| 5422 | 13년 전 | 1841 | ||
| 5421 |
PHPㅡASP프로그래머
|
13년 전 | 810 | |
| 5420 |
|
13년 전 | 1638 | |
| 5419 | 13년 전 | 831 | ||
| 5418 | 13년 전 | 715 | ||
| 5417 | 13년 전 | 639 | ||
| 5416 | 13년 전 | 1000 | ||
| 5415 | 13년 전 | 792 | ||
| 5414 | 13년 전 | 738 | ||
| 5413 | 13년 전 | 819 | ||
| 5412 | 13년 전 | 1381 | ||
| 5411 | 13년 전 | 900 | ||
| 5410 | 13년 전 | 1293 | ||
| 5409 | 13년 전 | 4286 | ||
| 5408 | 13년 전 | 1005 | ||
| 5407 |
ckflower
|
13년 전 | 2454 | |
| 5406 |
ddokkani
|
13년 전 | 1404 | |
| 5405 | 13년 전 | 1607 | ||
| 5404 | 13년 전 | 684 | ||
| 5403 | 13년 전 | 718 | ||
| 5402 |
밤거리빵빵
|
13년 전 | 6033 | |
| 5401 |
PHPㅡASP프로그래머
|
13년 전 | 992 | |
| 5400 |
|
13년 전 | 1224 | |
| 5399 | 13년 전 | 5022 | ||
| 5398 |
부산아무개
|
13년 전 | 1673 | |
| 5397 | 13년 전 | 2468 | ||
| 5396 | 13년 전 | 1861 | ||
| 5395 | 13년 전 | 1070 | ||
| 5394 | 13년 전 | 1152 | ||
| 5393 | 13년 전 | 1059 | ||
| 5392 |
아르toria
|
13년 전 | 778 | |
| 5391 |
|
13년 전 | 1158 | |
| 5390 |
디지털홍익인간
|
13년 전 | 7725 | |
| 5389 | 13년 전 | 3126 | ||
| 5388 | 13년 전 | 881 | ||
| 5387 |
WaaNee
|
13년 전 | 1923 | |
| 5386 | 13년 전 | 2119 | ||
| 5385 | 13년 전 | 4638 | ||
| 5384 | 13년 전 | 955 | ||
| 5383 | 13년 전 | 2149 | ||
| 5382 | 13년 전 | 680 | ||
| 5381 |
JacobJeon
|
13년 전 | 1097 | |
| 5380 | 13년 전 | 1148 | ||
| 5379 | 13년 전 | 689 | ||
| 5378 | 13년 전 | 10483 | ||
| 5377 | 13년 전 | 884 | ||
| 5376 | 13년 전 | 1470 | ||
| 5375 | 13년 전 | 851 | ||
| 5374 | 13년 전 | 856 | ||
| 5373 | 13년 전 | 2073 | ||
| 5372 | 13년 전 | 1703 | ||
| 5371 |
|
13년 전 | 1651 | |
| 5370 | 13년 전 | 2916 | ||
| 5369 |
아자12345
|
13년 전 | 1025 | |
| 5368 | 13년 전 | 720 | ||
| 5367 | 13년 전 | 1099 | ||
| 5366 | 13년 전 | 2159 | ||
| 5365 | 13년 전 | 1577 | ||
| 5364 | 13년 전 | 1107 | ||
| 5363 |
|
13년 전 | 1382 | |
| 5362 | 13년 전 | 838 | ||
| 5361 | 13년 전 | 1411 | ||
| 5360 | 13년 전 | 775 | ||
| 5359 | 13년 전 | 1410 | ||
| 5358 | 13년 전 | 1247 | ||
| 5357 | 13년 전 | 1647 | ||
| 5356 | 13년 전 | 1137 | ||
| 5355 |
techer
|
13년 전 | 1385 | |
| 5354 |
|
13년 전 | 1037 | |
| 5353 | 13년 전 | 753 | ||
| 5352 | 13년 전 | 844 | ||
| 5351 | 13년 전 | 1225 | ||
| 5350 | 13년 전 | 757 | ||
| 5349 |
|
13년 전 | 1445 | |
| 5348 | 13년 전 | 854 | ||
| 5347 | 13년 전 | 760 | ||
| 5346 | 13년 전 | 882 | ||
| 5345 | 13년 전 | 818 | ||
| 5344 |
후라보노보노
|
13년 전 | 1960 | |
| 5343 | 13년 전 | 1165 | ||
| 5342 | 13년 전 | 1131 | ||
| 5341 | 13년 전 | 2076 | ||
| 5340 |
|
13년 전 | 1120 | |
| 5339 |
AMDbest
|
13년 전 | 744 | |
| 5338 | 13년 전 | 739 | ||
| 5337 |
프로프리랜서
|
13년 전 | 1487 | |
| 5336 |
프로프리랜서
|
13년 전 | 934 | |
| 5335 | 13년 전 | 733 | ||
| 5334 |
|
13년 전 | 983 | |
| 5333 | 13년 전 | 2849 | ||
| 5332 | 13년 전 | 1534 | ||
| 5331 | 13년 전 | 1334 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기