ubuntu Postgresql binary 설치 시 initdb: cannot be run as root 오류
Postgresql 을 ubuntu 에서
apt-get이 아닌 binary 로 직접 설치하려고
https://www.postgresdba.com/bbs/board.php?bo_table=C05&wr_id=26
커뮤니티 > 나만의 강좌및 팁 > 디비랑-6) PostgreSQL Binary/수동 설치 - All About PostgreSQL
## ## CentOS 6.4, PostgreSQL 9.2.4 community ## ## 1. PostgreSQL 다운로드 ㅇ http://www.postgresql.org/ftp/source 에서 확인. root# cd /usr/local/src root# wget http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.gz root# tar zxvf postgresql-9.2.4.t
www.postgresdba.com
이 블로그를 참조하여 설치를 하던 중
make check 를 하는 부분에서
이런 에러가 났습니다.
인터넷을 아무리 뒤져도 해결방법이 나오지 않아서
로그 파일을 찾아보니
이렇게 initdb는 postgres 계정만 실행할 수 있기 때문에 에러가 발생한 것을 알 수 있었습니다.
그래서
su - postgres
로 접속하여 다시
make check
를 실행해보니
파일을 생성할 수 있는 권한이 없어서
Permission Denied
에러가 발생하였습니다.
그래서 다시 root 계정으로 돌아와서
chown -fR postgres:postgres ./*
로 postgres 계정에 읽고 쓸 수 있는 권한을 부여하니
오류가 해결되었습니다.