Lesson-41 PostgreSQL新手入门

MAC 安装 postgresql

brew install postgresql

创建postgreSql数据库:

initdb /usr/local/var/postgres

启动服务:

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

停止服务:

pg_ctl -D /usr/local/var/postgres stop -s -m fast

自动启动服务:

mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.2.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

删除自动启动服务:

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容