conn=psycopg2.connect(database="aigdb",user="wlaigadmin",password="wlaigadmin",host="max-SYSTEM-PRODUCT-NAME",port="5432")
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "max-SYSTEM-PRODUCT-NAME" (127.0.1.1) and accepting
TCP/IP connections on port 5432?
简单一点,可以暂时把防火墙关闭, 看是否正常。
如果正常了,就把 防火墙 的 5432 和 postgresql 用到的端口,设置为通过许可。 这样试试。