1、安装
打开MacBook命令行窗口,执行如下命令:
(1)查看可用版本Postgres
brew search postgresql
(2)安装Postgres
brew install postgresql@9.5 -v
如果顺利安装成功,将会在安装结束后输出如下信息:
If you need to have postgresql@9.5 first in your PATH run:
echo 'export PATH="/usr/local/opt/postgresql@9.5/bin:$PATH"' >> ~/.bash_profile
For compilers to find postgresql@9.5 you may need to set:
export LDFLAGS="-L/usr/local/opt/postgresql@9.5/lib"
export CPPFLAGS="-I/usr/local/opt/postgresql@9.5/include"
For pkg-config to find postgresql@9.5 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/postgresql@9.5/lib/pkgconfig"
To have launchd start postgresql@9.5 now and restart at login:
brew services start postgresql@9.5
Or, if you don't want/need a background service you can just run:
pg_ctl -D /usr/local/var/postgresql@9.5 start
(3)配置Postgres
配置文件:
/usr/local/var/postgresql@9.5/postgresql.conf
启动:
brew services start postgresql@9.5
停止:
brew services stop postgresql@9.5
重启:
brew services restart postgresql@9.5
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/10454.html