我已经在OSX上安装了postgresql。当我运行psql时,我得到
$ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5433"?
但是,来自/ etc / services
postgresql 5432/udp # PostgreSQL Database
postgresql 5432/tcp # PostgreSQL Database
# Tom Lane <tgl@sss.pgh.pa.us>
pyrrho 5433/tcp # Pyrrho DBMS
pyrrho 5433/udp # Pyrrho DBMS
5433被pyrrho占据,5432被分配给pg。我可以与
psql -p 5432
但是为什么psql认为它是5433,默认情况下如何使psql在正确的位置显示?
PGPORT
定义了环境变量:postgresql.org/docs/current/static/libpq-envars.html