테스트: 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;
?>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5130 | 13년 전 | 760 | ||
| 5129 | 13년 전 | 1765 | ||
| 5128 | 13년 전 | 932 | ||
| 5127 | 13년 전 | 514 | ||
| 5126 | 13년 전 | 762 | ||
| 5125 | 13년 전 | 1371 | ||
| 5124 | 13년 전 | 842 | ||
| 5123 | 13년 전 | 477 | ||
| 5122 | 13년 전 | 1000 | ||
| 5121 |
|
13년 전 | 1383 | |
| 5120 | 13년 전 | 507 | ||
| 5119 | 13년 전 | 484 | ||
| 5118 | 13년 전 | 412 | ||
| 5117 | 13년 전 | 726 | ||
| 5116 | 13년 전 | 469 | ||
| 5115 | 13년 전 | 917 | ||
| 5114 | 13년 전 | 940 | ||
| 5113 |
cookieyou
|
13년 전 | 1355 | |
| 5112 | 13년 전 | 538 | ||
| 5111 | 13년 전 | 829 | ||
| 5110 | 13년 전 | 4441 | ||
| 5109 | 13년 전 | 1062 | ||
| 5108 | 13년 전 | 421 | ||
| 5107 | 13년 전 | 493 | ||
| 5106 | 13년 전 | 642 | ||
| 5105 | 13년 전 | 1106 | ||
| 5104 | 13년 전 | 415 | ||
| 5103 |
프로프리랜서
|
13년 전 | 1350 | |
| 5102 | 13년 전 | 1591 | ||
| 5101 | 13년 전 | 465 | ||
| 5100 | 13년 전 | 375 | ||
| 5099 | 13년 전 | 524 | ||
| 5098 | 13년 전 | 2138 | ||
| 5097 | 13년 전 | 384 | ||
| 5096 | 13년 전 | 536 | ||
| 5095 | 13년 전 | 388 | ||
| 5094 | 13년 전 | 398 | ||
| 5093 | 13년 전 | 882 | ||
| 5092 | 13년 전 | 1068 | ||
| 5091 | 13년 전 | 427 | ||
| 5090 | 13년 전 | 519 | ||
| 5089 | 13년 전 | 964 | ||
| 5088 | 13년 전 | 420 | ||
| 5087 | 13년 전 | 1176 | ||
| 5086 | 13년 전 | 1509 | ||
| 5085 |
|
13년 전 | 3943 | |
| 5084 |
alexseo
|
13년 전 | 925 | |
| 5083 | 13년 전 | 1131 | ||
| 5082 | 13년 전 | 608 | ||
| 5081 | 13년 전 | 530 | ||
| 5080 | 13년 전 | 612 | ||
| 5079 | 13년 전 | 991 | ||
| 5078 | 13년 전 | 2210 | ||
| 5077 | 13년 전 | 684 | ||
| 5076 |
몰보는거야
|
13년 전 | 1696 | |
| 5075 |
|
13년 전 | 1775 | |
| 5074 | 13년 전 | 2022 | ||
| 5073 |
|
13년 전 | 775 | |
| 5072 |
프로프리랜서
|
13년 전 | 1045 | |
| 5071 |
프로프리랜서
|
13년 전 | 767 | |
| 5070 |
프로프리랜서
|
13년 전 | 878 | |
| 5069 |
뭐먹고살지ㅠ
|
13년 전 | 793 | |
| 5068 |
danielle
|
13년 전 | 655 | |
| 5067 | 13년 전 | 765 | ||
| 5066 | 13년 전 | 837 | ||
| 5065 | 13년 전 | 909 | ||
| 5064 | 13년 전 | 1723 | ||
| 5063 | 13년 전 | 443 | ||
| 5062 | 13년 전 | 833 | ||
| 5061 | 13년 전 | 586 | ||
| 5060 | 13년 전 | 395 | ||
| 5059 |
senseme
|
13년 전 | 868 | |
| 5058 | 13년 전 | 2883 | ||
| 5057 | 13년 전 | 1942 | ||
| 5056 | 13년 전 | 1498 | ||
| 5055 | 13년 전 | 454 | ||
| 5054 |
senseme
|
13년 전 | 1072 | |
| 5053 |
senseme
|
13년 전 | 1912 | |
| 5052 |
senseme
|
13년 전 | 1039 | |
| 5051 |
senseme
|
13년 전 | 1061 | |
| 5050 |
senseme
|
13년 전 | 807 | |
| 5049 |
senseme
|
13년 전 | 991 | |
| 5048 | 13년 전 | 1995 | ||
| 5047 | 13년 전 | 498 | ||
| 5046 |
우렁찬우렁이
|
13년 전 | 890 | |
| 5045 |
크라이스트
|
13년 전 | 2162 | |
| 5044 | 13년 전 | 974 | ||
| 5043 | 13년 전 | 537 | ||
| 5042 | 13년 전 | 983 | ||
| 5041 |
|
13년 전 | 815 | |
| 5040 |
스마일라니
|
13년 전 | 881 | |
| 5039 | 13년 전 | 1154 | ||
| 5038 | 13년 전 | 1931 | ||
| 5037 | 13년 전 | 1050 | ||
| 5036 |
cookieyou
|
13년 전 | 1406 | |
| 5035 | 13년 전 | 502 | ||
| 5034 | 13년 전 | 566 | ||
| 5033 | 13년 전 | 490 | ||
| 5032 | 13년 전 | 439 | ||
| 5031 | 13년 전 | 733 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기