[Spring Boot #17] 스프링 PostgreSQL 연동 (Docker 활용)
- 📚 Spring/Spring Boot
- 2020. 6. 4. 00:55
| PostgreSQL 도커 띄우기 - 윈도우
PostgreSQL 이미지 실행
docker run -p 5432:5432 -e POSTGRES_PASSWORD=pass -e POSTGRES_USER=kyhslam -e POSTGRES_DB=springboot --name postgres_boot -d postgres
실행 확인
실행된 도커의 bash shell에 접속
docker exec -i -t postgres_boot bash
postgres로 유저를 바꾸고 kyhslam 계정으로 접속
su - postgres
psql springboot -U kyhslam
또는
psql --username kyhslam --dbname springboot
Database 목록조회
## 릴레이션 리스트
\l
## 테이블 정보
\dt
'📚 Spring > Spring Boot' 카테고리의 다른 글
[Spring Boot #19] Lombok 정리 (0) | 2020.06.27 |
---|---|
[Spring Boot #18] 스프링 부트 RestTemplate, WebClient (0) | 2020.06.09 |
[Spring Boot #16] 스프링 ExceptionHandler (0) | 2020.05.14 |
[Spring Boot #15] 스프링 웹 MVC - HtmlUnit 써보기 (0) | 2020.05.04 |
[Spring Boot #14] 스프링 웹 MVC - Thymeleaf (0) | 2020.05.04 |