[英]psql crash: No such file or directory on m1 Mac
I was coding and suddenly my mac froze, I couldn't really do much and I force shutdown my mac and after restarting my code won't run saying it can't connect to the database.
我正在编码,突然我的 mac 卡住了,我真的做不了太多,我强行关闭了我的 mac,重新启动后我的代码无法运行,说它无法连接到数据库。 I checked if psql had any issue and this error message pops up.
我检查了 psql 是否有任何问题,并弹出此错误消息。 "psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory. Is the server running locally and accepting connections on that socket?"
“psql:错误:连接到套接字“/tmp/.s.PGSQL.5432”上的服务器失败:没有这样的文件或目录。服务器是否在本地运行并接受该套接字上的连接?” I tried everything to fix even trying to reinstall psql and nothing works.
我尝试了所有修复方法,甚至尝试重新安装 psql,但没有任何效果。 I found a tutorial online saying to check the /usr/local/var/postgres and deleting ostmaster.pid.
我在网上找到一个教程,说要检查 /usr/local/var/postgres 并删除 ostmaster.pid。 But I can't find that file anywhere.
但我无法在任何地方找到该文件。 My /usr/local is also a bit different, I don't have these files var/postgres.
我的 /usr/local 也有点不同,我没有这些文件 var/postgres。 I'm freaking out rn:'(
我吓坏了rn:'(
Try checking the environment variables on your pc and check to see if psql is in the path.尝试检查您电脑上的环境变量并检查 psql 是否在路径中。 this make fix the issue
这使解决问题
Nvm just fixed it, the file is under homebrew. Nvm 刚刚修复了它,该文件在自制软件下。 I deleted it and now everything works again!
我删除了它,现在一切都恢复正常了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.