Can't connect the postgreSQL with psycopg2

后端 未结 6 538
无人及你
无人及你 2020-11-30 04:08

It\'s the first time that I can\'t find the answer about some tech problems Here\'s my problems:

>> conn=psycopg2.connect(database=\"mydb\", user=\"pos         


        
6条回答
  •  难免孤独
    2020-11-30 04:31

    Having this happen to me after a brew upgrade, I googled for brew .s.PGSQL.5432.

    Per the suggestion in this answer I ran the following:

    postgres -D /usr/local/var/postgres
    

    And got:

    2019-10-29 17:43:30.860 IST [78091] FATAL:  database files are incompatible with server
    2019-10-29 17:43:30.860 IST [78091] DETAIL:  The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.5.
    

    I googled that FATAL error and per the suggestion in this answer I ran:

    brew postgresql-upgrade-database
    

    That solved it for me.

提交回复
热议问题