title: Prisma cannot authenticate database server
body: <p>I'm using docker to initiate a postgres db:</p>
  <pre><code>version: '3.8'
  services:
    postgres:
      image: postgres:13
      restart: always
      environment:
        POSTGRES_USER: db_user
        POSTGRES_PASSWORD: db_password
      volumes:
        - postgres:/var/lib/postgresql/data
      ports:
        - '5432:5432'
  volumes:
      postgres:
  </code></pre>
  <p>and in my <code>/.env</code> file I have:</p>
  <pre><code>DATABASE_URL=&quot;postgresql://db_user:db_password@localhost:5432/college_db?schema=public&quot;
  </code></pre>
  <p>I start docker:</p>
  <pre><code>PS C:\Users\alucardu\Documents\projects\**-react&gt; docker-compose up -d
  Starting **-react_postgres_1 ... done
  </code></pre>
  <p>Check if the server is running:</p>
  <pre><code>PS C:\Users\alucardu\Documents\projects\**-react&gt; docker ps
  CONTAINER ID   IMAGE         COMMAND                  CREATED         STATUS          PORTS                                       NAMES
  e0f9233ce34b   postgres:13   &quot;docker-entrypoint.s…&quot;   2 minutes ago   Up 33 seconds   0.0.0.0:5432-&gt;5432/tcp, :::5432-&gt;5432/tcp   **-react_postgres_1
  </code></pre>
  <p>But when I run a Prisma migrate I get an authentication error:</p>
  <pre><code>PS C:\Users\alucardu\Documents\projects\movieseat-react&gt; npx prisma migrate dev --name &quot;init&quot;
  Environment variables loaded from .env
  Prisma schema loaded from prisma\schema.prisma
  Datasource &quot;db&quot;: PostgreSQL database &quot;college_db&quot;, schema &quot;public&quot; at &quot;localhost:5432&quot;
  
  Error: P1000: Authentication failed against database server at `localhost`, the provided database credentials for `db_user` are not valid.
  
  Please make sure to provide valid database credentials for the database server at `localhost`.
  </code></pre>
  <p>Why is Prisma not matching the set <code>db_user</code> and <code>db_password</code> to the environment variables created in the docker yml?</p>
  <p>//edit.</p>
  <p>I've added a <code>college_db</code> database and a superuser called <code>db_user</code> and made it owner of the <code>college_db</code>:</p>
  <p><a href="https://i.stack.imgur.com/2c0wf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2c0wf.png" alt="enter image description here" /></a></p>
  <p>But I'm still getting the same error.</p>