Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 启动Postgres服务器_Macos_Postgresql_Server - Fatal编程技术网

Macos 启动Postgres服务器

Macos 启动Postgres服务器,macos,postgresql,server,Macos,Postgresql,Server,我启动postgres服务器时运气不好。我可以从终端向postgres添加新的数据库、表等,但不能通过网页向表中添加内容。该网页目前正在本地主机上运行 postgres数据文件夹最初是在根用户中创建的,但我将其移动到了自己的用户帐户,解决了许多问题,但我又回到了输入postgres-D数据后一直遇到的旧错误(数据是数据群集文件夹) 我尝试了两个不同的命令来启动服务器 pg_ctl -D data -l logfile start 这给了我这个,但不正确 server starting 及

我启动postgres服务器时运气不好。我可以从终端向postgres添加新的数据库、表等,但不能通过网页向表中添加内容。该网页目前正在本地主机上运行

postgres数据文件夹最初是在根用户中创建的,但我将其移动到了自己的用户帐户,解决了许多问题,但我又回到了输入
postgres-D数据后一直遇到的旧错误(数据是数据群集文件夹)

我尝试了两个不同的命令来启动服务器

pg_ctl -D data -l logfile start 
这给了我这个,但不正确

server starting

这给了我这个

LOG:  skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf"
pg_ctl: another server might be running; trying to start server anyway
server starting
postgresql.auto.conf文件肯定有正确的名称和所有内容。如果我尝试停止假定已启动的服务器,则会导致我尝试的第一个命令中的第一个停止,第二个命令中的第二个停止

Is server running?


很明显,还有另一个postgres正在运行的例子。您必须在手动启动之前停止该操作,因为这将与端口号冲突

sudo launchctl stop com.edb.launchd.postgresql-9.4


使用您的命令尝试并启动

似乎有什么东西已经在使用端口
5432

尝试找出哪个程序(可能是postgres的另一个实例)正在阻塞该端口,并决定是否停止该其他进程

作为替代方案,重新配置postgres以使用其他端口

通过在控制台中键入以下内容,您可能会发现是什么阻止了该端口:

lsof -n -i4TCP:5432 | grep LISTEN

Postgres确实已经在5432端口上运行。我想知道为什么当我尝试pg_ctl-D/Library/PostgreSQL/9.4/data status时说没有服务器在运行
Is server running?
LOG:  skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf"
pg_ctl: could not send stop signal (PID: 83): Operation not permitted
lsof -n -i4TCP:5432 | grep LISTEN