테스트: 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;
?>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8030 | 9년 전 | 357 | ||
| 8029 | 9년 전 | 296 | ||
| 8028 | 9년 전 | 258 | ||
| 8027 | 9년 전 | 273 | ||
| 8026 | 9년 전 | 326 | ||
| 8025 | 9년 전 | 375 | ||
| 8024 | 9년 전 | 337 | ||
| 8023 | 9년 전 | 386 | ||
| 8022 | 9년 전 | 314 | ||
| 8021 | 9년 전 | 325 | ||
| 8020 | 9년 전 | 312 | ||
| 8019 | 9년 전 | 337 | ||
| 8018 | 9년 전 | 441 | ||
| 8017 | 9년 전 | 534 | ||
| 8016 | 9년 전 | 322 | ||
| 8015 | 9년 전 | 383 | ||
| 8014 | 9년 전 | 320 | ||
| 8013 | 9년 전 | 231 | ||
| 8012 | 9년 전 | 239 | ||
| 8011 | 9년 전 | 442 | ||
| 8010 | 9년 전 | 295 | ||
| 8009 | 9년 전 | 276 | ||
| 8008 | 9년 전 | 282 | ||
| 8007 | 9년 전 | 423 | ||
| 8006 | 9년 전 | 459 | ||
| 8005 |
|
9년 전 | 965 | |
| 8004 | 9년 전 | 349 | ||
| 8003 | 9년 전 | 414 | ||
| 8002 | 9년 전 | 321 | ||
| 8001 |
|
9년 전 | 663 | |
| 8000 | 9년 전 | 411 | ||
| 7999 | 9년 전 | 370 | ||
| 7998 | 9년 전 | 423 | ||
| 7997 | 9년 전 | 306 | ||
| 7996 | 9년 전 | 530 | ||
| 7995 | 9년 전 | 453 | ||
| 7994 | 9년 전 | 321 | ||
| 7993 | 9년 전 | 381 | ||
| 7992 | 9년 전 | 502 | ||
| 7991 | 9년 전 | 246 | ||
| 7990 | 9년 전 | 271 | ||
| 7989 | 9년 전 | 297 | ||
| 7988 | 9년 전 | 720 | ||
| 7987 | 9년 전 | 417 | ||
| 7986 | 9년 전 | 407 | ||
| 7985 | 9년 전 | 506 | ||
| 7984 | 9년 전 | 425 | ||
| 7983 | 9년 전 | 655 | ||
| 7982 | 9년 전 | 508 | ||
| 7981 | 9년 전 | 460 | ||
| 7980 | 9년 전 | 488 | ||
| 7979 | 9년 전 | 460 | ||
| 7978 | 9년 전 | 443 | ||
| 7977 | 9년 전 | 385 | ||
| 7976 | 9년 전 | 846 | ||
| 7975 | 9년 전 | 357 | ||
| 7974 | 9년 전 | 387 | ||
| 7973 | 9년 전 | 591 | ||
| 7972 | 9년 전 | 376 | ||
| 7971 | 9년 전 | 454 | ||
| 7970 | 9년 전 | 290 | ||
| 7969 | 9년 전 | 537 | ||
| 7968 | 9년 전 | 378 | ||
| 7967 | 9년 전 | 363 | ||
| 7966 | 9년 전 | 366 | ||
| 7965 |
|
9년 전 | 1008 | |
| 7964 | 9년 전 | 395 | ||
| 7963 | 9년 전 | 388 | ||
| 7962 | 9년 전 | 368 | ||
| 7961 |
전갈자리남자
|
9년 전 | 502 | |
| 7960 | 9년 전 | 958 | ||
| 7959 | 9년 전 | 548 | ||
| 7958 | 9년 전 | 404 | ||
| 7957 | 9년 전 | 363 | ||
| 7956 | 9년 전 | 365 | ||
| 7955 | 9년 전 | 445 | ||
| 7954 | 9년 전 | 371 | ||
| 7953 | 9년 전 | 421 | ||
| 7952 | 9년 전 | 352 | ||
| 7951 | 9년 전 | 499 | ||
| 7950 | 9년 전 | 382 | ||
| 7949 | 9년 전 | 383 | ||
| 7948 | 9년 전 | 321 | ||
| 7947 | 9년 전 | 927 | ||
| 7946 | 9년 전 | 423 | ||
| 7945 | 9년 전 | 391 | ||
| 7944 | 9년 전 | 415 | ||
| 7943 | 9년 전 | 369 | ||
| 7942 | 9년 전 | 401 | ||
| 7941 | 9년 전 | 384 | ||
| 7940 | 9년 전 | 877 | ||
| 7939 | 9년 전 | 348 | ||
| 7938 | 9년 전 | 378 | ||
| 7937 | 9년 전 | 273 | ||
| 7936 | 9년 전 | 879 | ||
| 7935 | 9년 전 | 441 | ||
| 7934 | 9년 전 | 411 | ||
| 7933 | 9년 전 | 502 | ||
| 7932 | 9년 전 | 473 | ||
| 7931 | 9년 전 | 525 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기