连接数据库时,如果报以下错误:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server on socket "@127.0.0.1/.s.PGSQL.5432" failed: Invalid argument (0x00002726/10022)
Is the server running locally and accepting connections on that socket?
(Background on this error at: https://sqlalche.me/e/14/e3q8)
DATABASE_URI = 'postgresql+psycopg2://........'
如果你用这种方式连接,大概是因为你的passward里有@,把@换成%40,就好了。
如果还不对,记得看看你的管理员身份的名称是正确的吗?
找了很久答案才知道....