테스트: 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;
?>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5030 | 13년 전 | 784 | ||
| 5029 | 13년 전 | 465 | ||
| 5028 | 13년 전 | 729 | ||
| 5027 | 13년 전 | 1318 | ||
| 5026 | 13년 전 | 548 | ||
| 5025 | 13년 전 | 1370 | ||
| 5024 | 13년 전 | 424 | ||
| 5023 | 13년 전 | 662 | ||
| 5022 | 13년 전 | 429 | ||
| 5021 | 13년 전 | 667 | ||
| 5020 | 13년 전 | 516 | ||
| 5019 | 13년 전 | 859 | ||
| 5018 | 13년 전 | 906 | ||
| 5017 | 13년 전 | 783 | ||
| 5016 | 13년 전 | 2629 | ||
| 5015 | 13년 전 | 416 | ||
| 5014 | 13년 전 | 677 | ||
| 5013 | 13년 전 | 588 | ||
| 5012 |
JacobJeon
|
13년 전 | 1075 | |
| 5011 | 13년 전 | 806 | ||
| 5010 | 13년 전 | 1443 | ||
| 5009 |
JacobJeon
|
13년 전 | 1802 | |
| 5008 | 13년 전 | 1152 | ||
| 5007 | 13년 전 | 3017 | ||
| 5006 |
|
13년 전 | 1307 | |
| 5005 | 13년 전 | 698 | ||
| 5004 | 13년 전 | 2106 | ||
| 5003 | 13년 전 | 2531 | ||
| 5002 | 13년 전 | 387 | ||
| 5001 | 13년 전 | 520 | ||
| 5000 | 13년 전 | 427 | ||
| 4999 | 13년 전 | 526 | ||
| 4998 | 13년 전 | 474 | ||
| 4997 | 13년 전 | 661 | ||
| 4996 | 13년 전 | 1919 | ||
| 4995 | 13년 전 | 393 | ||
| 4994 | 13년 전 | 383 | ||
| 4993 | 13년 전 | 529 | ||
| 4992 | 13년 전 | 503 | ||
| 4991 | 13년 전 | 388 | ||
| 4990 | 13년 전 | 710 | ||
| 4989 | 13년 전 | 653 | ||
| 4988 | 13년 전 | 401 | ||
| 4987 | 13년 전 | 422 | ||
| 4986 | 13년 전 | 1380 | ||
| 4985 | 13년 전 | 665 | ||
| 4984 | 13년 전 | 1047 | ||
| 4983 | 13년 전 | 413 | ||
| 4982 |
쥬드125
|
13년 전 | 1019 | |
| 4981 | 13년 전 | 548 | ||
| 4980 | 13년 전 | 419 | ||
| 4979 | 13년 전 | 694 | ||
| 4978 | 13년 전 | 2184 | ||
| 4977 |
atria
|
13년 전 | 865 | |
| 4976 | 13년 전 | 1532 | ||
| 4975 | 13년 전 | 440 | ||
| 4974 | 13년 전 | 467 | ||
| 4973 | 13년 전 | 707 | ||
| 4972 | 13년 전 | 462 | ||
| 4971 | 13년 전 | 1393 | ||
| 4970 | 13년 전 | 370 | ||
| 4969 | 13년 전 | 423 | ||
| 4968 | 13년 전 | 732 | ||
| 4967 | 13년 전 | 533 | ||
| 4966 | 13년 전 | 445 | ||
| 4965 | 13년 전 | 588 | ||
| 4964 | 13년 전 | 591 | ||
| 4963 | 13년 전 | 428 | ||
| 4962 | 13년 전 | 2252 | ||
| 4961 | 13년 전 | 1350 | ||
| 4960 | 13년 전 | 1234 | ||
| 4959 | 13년 전 | 429 | ||
| 4958 | 13년 전 | 383 | ||
| 4957 | 13년 전 | 472 | ||
| 4956 | 13년 전 | 702 | ||
| 4955 | 13년 전 | 494 | ||
| 4954 | 13년 전 | 1066 | ||
| 4953 | 13년 전 | 1160 | ||
| 4952 | 13년 전 | 755 | ||
| 4951 |
sjsmsrjfflauswnrsmse
|
13년 전 | 880 | |
| 4950 | 13년 전 | 1912 | ||
| 4949 | 13년 전 | 2223 | ||
| 4948 | 13년 전 | 5528 | ||
| 4947 | 13년 전 | 416 | ||
| 4946 | 13년 전 | 852 | ||
| 4945 | 13년 전 | 406 | ||
| 4944 | 13년 전 | 608 | ||
| 4943 |
마당쇠2000
|
13년 전 | 1257 | |
| 4942 |
cula100jak
|
13년 전 | 828 | |
| 4941 | 13년 전 | 475 | ||
| 4940 | 13년 전 | 574 | ||
| 4939 | 13년 전 | 419 | ||
| 4938 | 13년 전 | 568 | ||
| 4937 | 13년 전 | 1503 | ||
| 4936 |
techer
|
13년 전 | 1854 | |
| 4935 | 13년 전 | 726 | ||
| 4934 | 13년 전 | 961 | ||
| 4933 | 13년 전 | 2049 | ||
| 4932 |
kajama78
|
13년 전 | 964 | |
| 4931 | 13년 전 | 987 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기