일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- Database
- evaluation
- Converting
- judge
- enV
- format
- PostgreSQL
- LLM
- docker
- TORCH
- pytorch
- Flask
- Linux
- AI
- list
- CUDA
- numpy
- file
- KAKAO
- Laravel
- Mac
- GitLab
- Package
- pandas
- DB
- git
- Python
- Container
- Paper
- Windows
- Today
- Total
목록PostgreSQL (3)
Daily Develope
postgresql DB를 생성하고, adminer 웹 UI를 통해 쉽게 DB를 제어할 수 있는 컨테이너 환경 구성 환경 Docker : version 20.10.13 샘플코드 컨테이너 구성 파일 (db_docker_compose.yaml) 컨테이너 및 가상망 설정 Docker 가상 네트워크 생성 (네트워크명:db-network) adminer와 postgresql 컨테이너 생성 및 가상망과 연결 postgresql 설정 image : postgres alpine 3.18 이미지 port : 호스트 5432 포트와 컨테이너 5432 포트 연결 DB ID/PW : 환경변수 파일(.env)의 값을 불러와 설정 (POSTGRES_USER / POSTGRES_PWD) volume : 환경변수 파일(.env)에 ..
환경Python 3.9.7- modules : psycopg2Postgresql (Container, version:alpine3.18)- host : 127.0.0.1- port : 5432- database : mydb- 컨테이너 배포 샘플코드Connection Classimport psycopg2import loggingclass DBBaseController: def __init__(self, host:str="127.0.0.1", port:int=5432) -> None: self.__connect(host=host, port=port) def __connect(self, host:str="127.0.0.1", port:int=5432): try: ..
환경설정 : 설정 완료 이후에는 서비스 재시작 ($ systemctl restart postgresql) 기본 설정파일 : /etc/postgresql/{version}/main/postgresql.conf 예시) 접근가능 ip 설정 listen\_addresses = '\*'접근정책 설정파일 : /etc/postgresql/{version}/main/pg_hba.conf # 예시) 계정별 접근영역별 권한 설정 host all all 0.0.0.0/0 md5 # 설명 : host ip(도메인)에 대해서, 모든 DB에, 모든 사용자가, 어떠한 IP (0.0.0.0/0 모든 IP) 로, md5로 암호화된 비밀번호를 사용해 접근 가능 DB 접속 (Shell/Bash) $ psql -h [ip a..