进入postgresql数据库的方法
小编给大家分享一下进入postgresql数据库的方法,相信大部分人都还不怎么了解,因此分享这边文章给大家学习,希望大家阅读完这篇文章后大所收获,下面让我们一起去学习方法吧!
启动数据库服务器(posgres用户):
[postgres@localhostbin]$postgres-D/opt/postgresql/data/>/opt/postgresql/log/pg_server.log2>&1&[1]4508
推荐:postgresql教程
当然如果设置了环境变量
PGDATA=/opt/postgresql/dataexportPGDATA
后,可使用pg_ctl工具进行启动:
[postgres@localhostlog]$pg_ctlstart-l/opt/postgresql/log/pg_server.logpg_ctl:anotherservermightberunning;tryingtostartserveranywaypg_ctl:couldnotstartserverExaminethelogoutput.[postgres@localhostlog]$
当然,最简的启动方式是:
[postgres@localhost~]$pg_ctlstartserverstarting[postgres@localhost~]$LOG:databasesystemwasshutdownat2011-07-0913:58:00CSTLOG:autovacuumlauncherstartedLOG:databasesystemisreadytoacceptconnections
如果要在操作系统启动时就启动PG,可以在/etc/rc.d/rc.local文件中加以下语句:
/opt/postgresql/bin/pg_ctlstart-l/opt/postgresql/log/pg_server.log-D/opt/postgresql/data
以上是进入postgresql数据库的方法的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。