Closed Binsk-dev closed 1 year ago
환경 변수 POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB 값은 제가 새로 postgres 계정 같은걸 만들어서 얻어야 하나요?
임의로 지정하면 됩니다 On Mar 16, 2023 14:04 +0900, Jaewook-Lee @.***>, wrote:
환경 변수 POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB 값은 제가 새로 postgres 계정 같은걸 만들어서 얻어야 하나요? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because your review was requested.Message ID: @.***>
docker-compose up
이 sudo 권한을 요구해서 sudo docker-compose up
을 실행하니 아래와 같은 에러를 얻었습니다.
db | Error: Database is uninitialized and superuser password is not specified.
db | You must specify POSTGRES_PASSWORD to a non-empty value for the
db | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
db |
db | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
db | connections without a password. This is *not* recommended.
db |
db | See PostgreSQL documentation about "trust":
db | https://www.postgresql.org/docs/current/auth-trust.html
.envrc에서 환경 변수 값들을 다 1234로 설정했는데 super user에 대해서도 따로 설정해야 하나요?
docker가 sudo 권한을 요구하는 경우 별도로 sudo로 실행하지 마시고, sudo sudo usermod -aG docker $USER
명령어로 현재 유저가 docker를 실행할 수 있도록 그룹에 추가해주세요. 그 후 volumes 내 postgres 폴더 삭제, docker rm db
로 컨테이너 삭제, 이후 다시 docker compose up
으로 띄워보시기 바랍니다
On Mar 16, 2023 14:21 +0900, Jaewook-Lee @.***>, wrote:
docker-compose up 이 sudo 권한을 요구해서 sudo docker-compose up을 실행하니 아래와 같은 에러를 얻었습니다. db | Error: Database is uninitialized and superuser password is not specified. db | You must specify POSTGRES_PASSWORD to a non-empty value for the db | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run". db | db | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all db | connections without a password. This is not recommended. db | db | See PostgreSQL documentation about "trust": db | https://www.postgresql.org/docs/current/auth-trust.html .envrc에서 환경 변수 값들을 다 1234로 설정했는데 super user에 대해서도 따로 설정해야 하나요? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because your review was requested.Message ID: @.***>
@Jaewook-Lee @PricelessCode schema & table이 정상적으로 생성되면 Review 했다고 ✅ ㄱㄱㄱㄱ
저... docker exec -it db sh
로 들어가서 psql -h localhost -f model.sql
치는거 까지는 했는데... sql문을 어디에 치나요?
# select * from Opinion
치니까 sh: 2: select: not found
라고 뜨네요.
# select * from Opnion
치니까sh: 2: select: not found
라고 뜨네요.
Opinion..
코멘트 입력 과정에 오타가 있었습니다. 테스트 할 때는 오타 없었습니다.
DBeaver와 같은 별도의 DB 클라이언트를 사용해보겠어요? On Mar 17, 2023 09:04 +0900, Jaewook-Lee @.***>, wrote:
코멘트 입력 과정에 오타가 있었습니다. 테스트 할 때는 오타 없었습니다. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because your review was requested.Message ID: @.***>
후딱 체크 중입니다. 일을 하느라 어제 체크를 못했어요 ;~;
backend/model.sql
을 만들어 두었습니다. 이를 이용하기 위해서는 다음과 같은 작업을 합니다.docker cp [model_file_path] db:/model.sql
를 적용해 DDL 파일을 컨테이너 안으로 복사한다.docker exec
를 이용해 아래의 명령어를 실행psql -h localhost -f model.sql [DB이름] -U [DB유저이름]
실행