我正在尝试将我的Django应用程序与PostgreSQL
连接,并使用homebrew安装它。我的安装很成功,如您所见:
psql --version
psql (PostgreSQL) 9.4.5
对于安装,我遵循此处的指南link。根据本指南,安装完成后,请运行以下命令启动服务器。
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
当我运行第一个命令时,它显示错误:
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
ln: failed to create symbolic link ‘/home/rakesh/Library/LaunchAgents’: No such file or directory
然后当我运行第二个命令时,它显示launchctl: command not found
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl: command not found
在指南中运行命令还有另一个选项:postgres -D /usr/local/var/postgres
但是当我这样做时:
postgres -D /usr/local/var/postgres
postgres cannot access the server configuration file "/usr/local/var/postgres/postgresql.conf": No such file or directory
我花了很多时间在这上面,希望有人帮助我。你能告诉我,为什么我的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.5432"?