Prisma가 데이터베이스에 연결되지 않아요
Prisma가 데이터베이스에 연결되지 않을 때 P 코드와 연결 단계별 관찰값을 기록하고 일치하는 Problem 문서를 고릅니다.
빠른 답변
Prisma 연결 오류는 P 코드, 데이터베이스 호스트·포트에 도달했는지, 인증 정보가 맞는지, 연결 풀이 고갈됐는지를 분리해 확인해야 합니다. 실제 비밀번호는 기록하거나 공유하지 않습니다.
이 가이드가 맞는 경우
- 데이터베이스 연결 실패
- 애플리케이션 오류 메시지
상황별 다음 단계
Authentication failed against database server at {database_host}, the provided database credentials for {database_user} are not valid. Please make sure to provide valid database credentials for the database server at {database_host}.
Prisma 오류 코드가 P1000이고 데이터베이스 인증 실패가 표시됩니다.
The database server at {database_host}:{database_port} was reached but timed out. Please try again. Please make sure your database server is running at {database_host}:{database_port}.
Prisma 오류 코드가 P1002이고 데이터베이스 서버 연결 시간 초과가 표시됩니다.
Error opening a TLS connection: {message}
Prisma 오류 코드가 P1011이고 TLS 연결을 열 수 없다고 표시됩니다.
Server has closed the connection.
Prisma 오류 코드가 P1017이고 서버가 연결을 종료했다고 표시됩니다.
Timed out fetching a new connection from the connection pool. (More info: http://pris.ly/d/connection-pool (Current connection pool timeout: {timeout}, connection limit: {connection_limit})
Prisma 오류 코드가 P2024이고 연결 풀 시간 초과가 표시됩니다.
호스팅사·개발자에게 전달할 내용
변경 전 기록
- P 코드, 오류 발생 시각, 실행한 명령 또는 API 경로를 전달합니다.
- 데이터베이스 URL의 비밀번호·토큰은 마스킹합니다.
- 애플리케이션과 데이터베이스의 네트워크 위치, TLS 사용 여부, 동시 요청량을 기록합니다.
알아둘 점
이 문서는 Prisma가 데이터베이스에 연결되지 않아요라는 시작 상황에서 오류 코드와 네트워크 단계를 기준으로 다음 Problem 문서를 고릅니다. 데이터베이스 URL 전체를 로그에 남기지 않습니다.
먼저 기록할 것
- P 코드와 오류 문구를 원문 그대로 기록합니다.
- 애플리케이션이 데이터베이스 호스트·포트에 도달하는지 확인합니다.
- 인증 실패인지, TLS 협상 실패인지, 연결 풀 고갈인지 구분합니다.
- 환경 변수와 로그를 공유할 때 비밀번호와 토큰을 마스킹합니다.
상황별 다음 단계
- P1000이면 Authentication failed against database server at {database_host}, the provided database credentials for {database_user} are not valid. Please make sure to provide valid database credentials for the database server at {database_host}. 문서를 확인합니다.
- P1002이면 The database server at {database_host}:{database_port} was reached but timed out. Please try again. Please make sure your database server is running at {database_host}:{database_port}. 문서를 확인합니다.
- P1011이면 Error opening a TLS connection: {message} 문서를 확인합니다.
- P1017이면 Server has closed the connection. 문서를 확인합니다.
- P2024이면 Timed out fetching a new connection from the connection pool. (More info: http://pris.ly/d/connection-pool (Current connection pool timeout: {timeout}, connection limit: {connection_limit}) 문서를 확인합니다.
P 코드가 다르면 오류 코드와 실행 환경을 보존한 뒤 Prisma의 공식 오류 참조에서 해당 코드를 먼저 확인하세요.
참고 자료
Prisma ORM error reference (새 창에서 열림)
Prisma · 공식 자료 · 확인 범위: p1000, p1002, p1011, p1017, p2024 · 확인일: 2026-07-27