테스트: 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;
?>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7330 | 11년 전 | 1712 | ||
| 7329 | 11년 전 | 954 | ||
| 7328 | 11년 전 | 2246 | ||
| 7327 | 11년 전 | 1737 | ||
| 7326 | 11년 전 | 3837 | ||
| 7325 | 11년 전 | 2302 | ||
| 7324 | 11년 전 | 4537 | ||
| 7323 |
호식이와미돌
|
11년 전 | 1324 | |
| 7322 |
호식이와미돌
|
11년 전 | 1168 | |
| 7321 | 11년 전 | 1815 | ||
| 7320 | 11년 전 | 1786 | ||
| 7319 | 11년 전 | 1343 | ||
| 7318 |
|
11년 전 | 1000 | |
| 7317 |
멋진남자임
|
11년 전 | 1645 | |
| 7316 |
잘살아보자
|
11년 전 | 1011 | |
| 7315 | 11년 전 | 1135 | ||
| 7314 | 11년 전 | 1372 | ||
| 7313 |
잘살아보자
|
11년 전 | 1143 | |
| 7312 | 11년 전 | 900 | ||
| 7311 |
사랑한데이
|
11년 전 | 2104 | |
| 7310 |
잘살아보자
|
11년 전 | 1914 | |
| 7309 |
잘살아보자
|
11년 전 | 3076 | |
| 7308 |
잘살아보자
|
11년 전 | 1031 | |
| 7307 |
잘살아보자
|
11년 전 | 795 | |
| 7306 | 11년 전 | 897 | ||
| 7305 |
잘살아보자
|
11년 전 | 2773 | |
| 7304 | 11년 전 | 1061 | ||
| 7303 | 11년 전 | 1254 | ||
| 7302 | 11년 전 | 769 | ||
| 7301 | 11년 전 | 1548 | ||
| 7300 |
mijaya
|
11년 전 | 1520 | |
| 7299 | 11년 전 | 938 | ||
| 7298 | 11년 전 | 1122 | ||
| 7297 | 11년 전 | 797 | ||
| 7296 | 11년 전 | 765 | ||
| 7295 | 11년 전 | 1588 | ||
| 7294 | 11년 전 | 944 | ||
| 7293 | 11년 전 | 835 | ||
| 7292 | 11년 전 | 924 | ||
| 7291 |
잘살아보자
|
11년 전 | 1110 | |
| 7290 |
잘살아보자
|
11년 전 | 794 | |
| 7289 | 11년 전 | 828 | ||
| 7288 |
잘살아보자
|
11년 전 | 1369 | |
| 7287 | 11년 전 | 853 | ||
| 7286 |
잘살아보자
|
11년 전 | 1356 | |
| 7285 | 11년 전 | 849 | ||
| 7284 | 11년 전 | 999 | ||
| 7283 | 11년 전 | 1026 | ||
| 7282 | 11년 전 | 789 | ||
| 7281 | 11년 전 | 829 | ||
| 7280 | 11년 전 | 1078 | ||
| 7279 | 11년 전 | 2003 | ||
| 7278 | 11년 전 | 834 | ||
| 7277 | 11년 전 | 844 | ||
| 7276 | 11년 전 | 776 | ||
| 7275 | 11년 전 | 1199 | ||
| 7274 | 11년 전 | 841 | ||
| 7273 | 11년 전 | 770 | ||
| 7272 | 11년 전 | 1089 | ||
| 7271 | 11년 전 | 1422 | ||
| 7270 | 11년 전 | 1044 | ||
| 7269 | 11년 전 | 983 | ||
| 7268 | 11년 전 | 1013 | ||
| 7267 | 11년 전 | 1864 | ||
| 7266 | 11년 전 | 926 | ||
| 7265 | 11년 전 | 975 | ||
| 7264 |
잘살아보자
|
11년 전 | 2736 | |
| 7263 |
잘살아보자
|
11년 전 | 2273 | |
| 7262 |
잘살아보자
|
11년 전 | 1149 | |
| 7261 |
잘살아보자
|
11년 전 | 1644 | |
| 7260 |
잘살아보자
|
11년 전 | 1266 | |
| 7259 | 11년 전 | 1182 | ||
| 7258 |
잘살아보자
|
11년 전 | 1312 | |
| 7257 |
잘살아보자
|
11년 전 | 1912 | |
| 7256 | 11년 전 | 959 | ||
| 7255 |
그누5입문
|
11년 전 | 1969 | |
| 7254 | 11년 전 | 2179 | ||
| 7253 |
|
11년 전 | 881 | |
| 7252 | 11년 전 | 1016 | ||
| 7251 | 11년 전 | 733 | ||
| 7250 | 11년 전 | 1708 | ||
| 7249 | 11년 전 | 1562 | ||
| 7248 |
sogo87
|
11년 전 | 1056 | |
| 7247 | 11년 전 | 957 | ||
| 7246 | 11년 전 | 723 | ||
| 7245 |
잘살아보자
|
11년 전 | 1094 | |
| 7244 | 11년 전 | 1546 | ||
| 7243 |
presee
|
11년 전 | 613 | |
| 7242 |
sogo87
|
11년 전 | 801 | |
| 7241 | 11년 전 | 926 | ||
| 7240 |
브라이언2
|
11년 전 | 934 | |
| 7239 |
|
11년 전 | 1148 | |
| 7238 | 11년 전 | 2643 | ||
| 7237 |
잘살아보자
|
11년 전 | 2281 | |
| 7236 |
dethos79
|
11년 전 | 1858 | |
| 7235 |
멋진남자임
|
11년 전 | 1420 | |
| 7234 | 11년 전 | 1359 | ||
| 7233 | 11년 전 | 2340 | ||
| 7232 | 11년 전 | 1621 | ||
| 7231 | 11년 전 | 2803 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기