PostgreSQL服务器无法在ArchLinux上启动:严重:无法创建锁文件»/run/postgresql/.s.PGSQL.5432.lock«

问题描述 投票:0回答:1

我在Arch中很新,而在PostgreSQL中是一个初学者,因此这可能是一个非常基本的问题。

我从extra安装了postgresql 11.5-4,从AUR安装了pgadmin 4,它们似乎都运行良好。我使用以下命令创建了一个测试数据库:

initdb -D /home/lg/test-db

我得到了答案:

You can start the db-server using:
pg_ctl -D /home/lg/test-db -l logdatei start

我尝试过并得到:

pg_ctl -D /home/lg/test-db -l logdatei start
waiting for serer to start.... stopped 
pg_ctl: could not start the server
check the log.

日志只说不能创建锁文件»/run/postgresql/.s.PGSQL.5432.lock«,因为找不到该文件夹​​。在/ run下没有名为“ postgresql”的文件夹。我想postgresql无法创建此文件夹,因为它没有权限。但是,在线发布的一些帖子建议将数据库的用户/所有者更改为sudo。但是,PostgreSQL可以防止这种情况。当我尝试使用任何命令作为sudo时,postgresql告诉我该命令不能以root用户身份运行。我在这里的思考肯定有一些非常基本的错误,但是我已经3个小时没有解决了。

postgresql archlinux
1个回答
0
投票

启动服务器之前,您必须从/run/postgresql中的unix_socket_directories中删除postgresql.conf

© www.soinside.com 2019 - 2024. All rights reserved.