piicatcher icon indicating copy to clipboard operation
piicatcher copied to clipboard

Unable to Connect to Postgres

Open rohitcoderCdefense opened this issue 2 years ago • 3 comments

Hi There,

I'm not sure, why i can't connect to postgres using this tool, credentials are correct. Postgres running on same server localhost:5432 used same username and password to login into psql and pgadmin4

Any ideas on this?

image

rohitcoderCdefense avatar Jun 04 '22 11:06 rohitcoderCdefense

If you are using docker then localhost is a docker container rather than your host machine, use host.docker.internal instead to access it

morty29 avatar Jun 09 '22 13:06 morty29

@morty29 Sorry, for delay but i am not running with docker, i tested with docker today and your solution works with that, but not working with system postgres

rohitcoderCdefense avatar Jun 14 '22 15:06 rohitcoderCdefense

This is problem with settings of postgresql on your local box. However it is hard to guess which setting is missing or misconfigured in your postgresql setup. Stackoverflow has a few different solutions. Can you try those? As such there is no restriction or known issue with using piicatcher with local postgres.

vrajat avatar Jun 23 '22 03:06 vrajat

Validated with host.docker.internal as hostname instead of localhost inside container and working as expected. Also we have added docker-compose.yml which has databases along with playground container of python. You can use

piicatcher catalog add-mysql --name mariadb_password --username root --database piidb --uri host.docker.internal --port 3306 --password ROOT_ACCESS_PASSWORD
piicatcher catalog scan --source-name mariadb_password

yjagdale avatar Dec 13 '22 06:12 yjagdale

Closing the issue for now, Please reopen if still face issue.

yjagdale avatar Dec 13 '22 06:12 yjagdale