0

I have an ASP.Net Core app on my local machine that uses postgresql. So I need to connect my postgresql database running in a docker container. I connect to this db with pgAdmin, but when I set the connection string on my app and run the command dotnet ef database update, it shows the following error

IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address.

My connection string looks like this

host=0.0.0.0;port=54320;database=mydatabase;user id=postgres;password=mypassword
Mofid.Moghimi
  • 907
  • 1
  • 6
  • 13
  • 1
    the ip address is not correct , use localhost or 127.0.0.1 instead – LinPy Sep 18 '19 at 08:11
  • 1
    `0.0.0.0` isn't a valid IP. Databases don't need any special syntax when they run inside docker. You need to find out what port the database listens to, even if you run Docker locally. A container has to be configured *explicitly* to expose internal ports to external traffic. – Panagiotis Kanavos Sep 18 '19 at 08:11

0 Answers0