我在我的Ubuntu上安装Postgresql时:
brew install postgres
现在我有:
psql --version
psql (PostgreSQL) 9.5.0如何自动启动服务?
在我的Mac上用自制的,我可以用:
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist但是Ubuntu是如何使用Linuxbrew的呢?
我试着:
brew services start postgresql
但上面写着:
sh: 1: list: not found
Error: Could not read the plist for `postgresql`!该怎么办呢?
发布于 2016-02-28 07:43:30
不是完全自动的,而是朝着正确的方向迈出了一步。在我的系统中,我做了以下工作:
$ pg_ctl start -D $HOME/.linuxbrew/var/postgres -l logfile您可以简单地在.bash_profile或.bashrc中创建别名,如下所示:
alias poston="pg_ctl start -D $HOME/.linuxbrew/var/postgres -l logfile"
alias postoff="pg_ctl stop -D $HOME/.linuxbrew/var/postgres"要测试所有这些(假设计算机上还没有数据库),还可以为当前用户创建一个数据库:
$ poston
$ createdb `whoami`
$ psqlhttps://stackoverflow.com/questions/35208691
复制相似问题