I'm trying to connecto to local PostgreSQL database (Windows 10) using psycopg2.
con = psycopg2.connect( database="postgres", user="postgres", password="*******", host="localhost", port="5432" ) I keep receiving not very informative OperationalError:
--------------------------------------------------------------------------- OperationalError Traceback (most recent call last) <ipython-input-8-198849577200> in <module> ----> 1 con = psycopg2.connect( 2 database="postgres", 3 user="postgres", 4 password="******", 5 host="localhost", ~\Anaconda3\envs\py38\lib\site-packages\psycopg2\__init__.py in connect(dsn, connection_factory, cursor_factory, **kwargs) 125 126 dsn = _ext.make_dsn(dsn, **kwargs) --> 127 conn = _connect(dsn, connection_factory=connection_factory, **kwasync) 128 if cursor_factory is not None: 129 conn.cursor_factory = cursor_factory OperationalError: Tryed to replace "localhost" by "127.0.0.1" with the same result. I see the database in psql with 5432 port and the same configuration. Any ideas what went wrong?
SHOW log_directory;in psql.sslmode="disable"in psycopg2