Skip to content

chore: 로컬 개발 DB docker-compose 전환 (sha256_password 접속오류 해결)#151

Closed
chanwoo7 wants to merge 1 commit into
developfrom
chore/dev-db-docker-compose
Closed

chore: 로컬 개발 DB docker-compose 전환 (sha256_password 접속오류 해결)#151
chanwoo7 wants to merge 1 commit into
developfrom
chore/dev-db-docker-compose

Conversation

@chanwoo7

@chanwoo7 chanwoo7 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

로컬 개발 DB를 docker-compose로 전환합니다. 네이티브 brew MySQL의 sha256_password 계정으로 yarn start가 막히던 문제를 해결합니다.

배경

  • 네이티브 mysql@8.4(brew)의 caquick 계정이 sha256_password 인증 플러그인 → Prisma 쿼리 엔진이 미지원(caching_sha2_password/mysql_native_password만 지원) → PrismaClientInitializationError: Unknown authentication plugin 'sha256_password'.
  • mysql:8.0 컨테이너는 기본 인증이 caching_sha2_password라 Prisma와 호환.

변경

  • docker-compose.dev.yml 추가 — 로컬 개발용 MySQL(8.0). 자격증명(caquick/caquick/CaQuick)·포트 3306·named volume(데이터 영속)·healthcheck 포함.
    • 자격증명은 .env.example의 기존 DATABASE_URL(mysql://caquick:caquick@localhost:3306/CaQuick)과 그대로 일치 → .env 변경 불필요.

참고: .env.example은 이 repo에서 .gitignore에 잡혀 있어 PR에 포함하지 않습니다(추적 대상 아님). docker-compose 사용 안내는 docker-compose.dev.yml 상단 주석에 포함했습니다.

사용법

brew services stop mysql@8.4                      # (네이티브 MySQL 사용 중이면) 3306 양보
docker compose -f docker-compose.dev.yml up -d    # 개발 DB 기동
yarn prisma migrate deploy                        # 스키마 적용
yarn prisma:seed                                  # 시드
yarn start

Test plan

  • 로컬 검증 완료: 컨테이너 기동 → migrate deploy(8 migrations 적용) → prisma:seed(지역 마스터 + 테스트 계정) → yarn start가 DB 연결을 통과해 listen 단계 도달(= sha256_password 오류 해소).
  • 코드(src) 변경 없음 — 인프라 파일(docker-compose.dev.yml)만.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fd3c1a02-cff0-4f6d-9a09-bcb1fd52b808

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/dev-db-docker-compose

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🧹 knip — dead-code 리포트

요약 항목 없음
전체 리포트
(knip 출력 없음 — 이슈 0이거나 실행 실패)

청소 후보(오탐 가능) · 기준 docs/guide/architecture-conventions.md

@github-actions

Copy link
Copy Markdown

🩺 NestJS Doctor — 88/100 (Good)

진단 254건 (error 0).

Category error warning info
architecture 0 0 13
correctness 0 105 0
performance 0 24 16
schema 0 0 83
security 0 13 0
architecture / security 상위 항목
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal type 'IAuditLogRepository'.
  • warning security/security/no-exposed-env-vars: Direct 'process.env.NODE_ENV' access in 'AuthController'. Use ConfigService instead.
  • warning security/security/require-guards-on-endpoints: Endpoint 'start' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'callback' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'refresh' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'logout' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerLogin' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerRefresh' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'sellerLogout' has no @UseGuards() at class or method level.
  • warning security/security/require-guards-on-endpoints: Endpoint 'devIssueToken' has no @UseGuards() at class or method level.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal module '@/features/conversation/repositories/conversation.repository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal type 'ConversationRepository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal module '@/features/order/repositories/order.repository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal type 'OrderRepository'.
  • info architecture/architecture/no-barrel-export-internals: Barrel file re-exports internal module '@/features/product/repositories/product.repository'.

오탐 포함 가능 · 기준 docs/guide/architecture-conventions.md

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d59d5e5261

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docker-compose.dev.yml
Comment on lines +23 to +25
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the MySQL auth workaround in dev compose

When a developer starts a fresh DB with this new file, the caquick user is created with MySQL 8's default auth because this command omits the workaround already used in docker-compose.yml:5-9 and the init script's ALTER USER in docker/mysql/init/01-grant-shadow-db.sql:5-8. The repo documents that Prisma 6.x can surface that default as the unsupported sha256_password, so this dev compose can reproduce the startup error the change is intended to avoid.

Useful? React with 👍 / 👎.

Comment thread docker-compose.dev.yml
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
volumes:
- caquick-mysql-data:/var/lib/mysql

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Grant the dev user shadow-database privileges

When this local DB is used with the existing dev migration flow (README.md:252-253 / package.json:22-23), Prisma migrate dev needs to create a shadow database; the existing init SQL grants that explicitly in docker/mysql/init/01-grant-shadow-db.sql:1-3. This new compose only mounts the data volume, so a fresh MYSQL_USER is limited to the CaQuick database and local migration creation will fail unless the init directory is mounted or equivalent CREATE/ALL privileges are granted.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 97.42% 3886/3989
🟢 Branches 93.21% 1208/1296
🟢 Functions 94.64% 724/765
🟢 Lines 97.82% 3551/3630

Test suite run success

1344 tests passing in 159 suites.

Report generated by 🧪jest coverage report action from d59d5e5

@chanwoo7

Copy link
Copy Markdown
Member Author

기존 docker-compose.yml 이 이미 동일 목적(mysql_native_password 로 Prisma sha256 인식 이슈 회피)으로 존재함을 확인. 중복이라 close 합니다. 실제 원인은 caquick-mysql 컨테이너 미기동 + 네이티브 brew mysql 의 3306 점유였음.

@chanwoo7 chanwoo7 closed this Jun 18, 2026
@chanwoo7 chanwoo7 deleted the chore/dev-db-docker-compose branch June 18, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant