0

Столкнулся с проблемой, вчера пользовался postgres, сегодня появилась ошибка, при этом ничего не меняя

import psycopg2

psycopg2.connect(
    database="postgres",
    user="postgres",
    password="qwerty123",
    host="localhost",
    port=5432
)

Ошибка: *conn = _connect(dsn, connection_factory=connection_factory, *kwasync) psycopg2.OperationalError: could not translate host name "('localhost'" to address: Unknown host could not translate host name ")" to address: Unknown host

1
  • host="127.0.0.1" попробуйте
    – Namerek
    28 мар 2022 в 5:20

1 ответ 1

0

Вы не поверите )

psycopg2.connect('database=postgres user=postgres password=qwerty123 host=localhost port=5432')

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.