数据库 | postgresql 安装
文章目录
当前项目是使用
django框架搭建接口层的业务,数据库端使用了postgresql,这里只是简单记录下自己的安装流程,因为开发机器使用的mac,所以流程只是针对mac。
1 软件管理工具
这里我使用的 homebrew,这个工具就不多说了,没有用过的可以到这里 http://brew.sh/
2 安装步骤
执行下面命令即可
brew install postgresql
3 服务管理
这里使用了 lunchy, 这是一个 ruby gem,安装执行下面命令
gem install lunchy
服务管理,下面执行一次就可以了,如果不懂什么是 plist,自己自行脑补
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
服务的启动和关闭命令如下
lunchy start postgres 启动服务
lunchy stop postgres 终止服务
lunchy restart postgres 重启服务
当然你也可以使用 mac 自带的 launchctl (http://www.ttianjun.com/2016/03/19/mac-cron/)
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论