安装(PostgreSQL)9.6.2 Sabayon linux?
问题描述:
当我尝试连接并访问或启动PostgreSQL时,出现此错误!安装(PostgreSQL)9.6.2 Sabayon linux?
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服务器应该正在运行。退出终端作为用户
postgres
,现在你可以使用下面的命令$ psql -U postgres
Tanks..Tanks..Tanks..Tanks进入
psql
终端.. –