如何进入postgresql

370次阅读
没有评论

如何进入postgresql

启动数据库服务器(posgres用户):

[postgres@localhost bin]$ postgres -D /opt/postgresql/data/ > /opt/postgresql/log/pg_server.log 2>&1 &
[1] 4508

当然如果设置了环境变量

PGDATA=/opt/postgresql/data
export PGDATA

后,可使用pg_ctl工具进行启动:

[postgres@localhost log]$ pg_ctl start -l /opt/postgresql/log/pg_server.log
pg_ctl: another server might be running; trying to start server anyway
pg_ctl: could not start server
Examine the log output.
[postgres@localhost log]$

当然,最简的启动方式是:

[postgres@localhost ~]$ pg_ctl start
server starting
[postgres@localhost ~]$ LOG:  database system was shut down at 2011-07-09 13:58:00 CST
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

 如果要在操作系统启动时就启动PG,可以在/etc/rc.d/rc.local 文件中加以下语句:

/opt/postgresql/bin/pg_ctl start -l /opt/postgresql/log/pg_server.log -D /opt/postgresql/data
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:postgresql2022-12-02发表,共计798字。
新手QQ群:570568346,欢迎进群讨论 Python51学习