在linux上安装(PostgreSQL)9.6.2 Sabayon?
当我尝试连接、访问或启动PostgreSQL时,我遇到了这个错误在linux上安装(PostgreSQL)9.6.2 Sabayon?,linux,postgresql,Linux,Postgresql,当我尝试连接、访问或启动PostgreSQL时,我遇到了这个错误 Sabayon postgresql-9.6 # sudo su -c "createuser --superuser gisuser" postgres Createuser: could not connect to database postgres: could not connect to server: File or directory not found The server is running locally
Sabayon postgresql-9.6 # sudo su -c "createuser --superuser gisuser" postgres
Createuser: could not connect to database postgres: could not connect to server: File or directory not found
The server is running locally and accepting
Connections in the Unix domain socket "/run/postgresql/.s.PGSQL.5432"?
Sabayon postgresql-9.6 # psql --version
Psql (PostgreSQL) 9.6.2
这意味着您的postgres服务器未运行 启动服务器的步骤:
$ mkdir /usr/db/
/usr/db/
$ chown postgres:postgres /usr/db/
$ chmod 757 /usr/db/
postgres
$ su postgres
$ initdb -D /usr/db/
$ pg_ctl start -D /usr/db/
postgres
,现在您可以使用以下命令进入psql
终端
$ psql -U postgres