(7)初始化并启动postgresql
[root@server1 yum.repos.d]# service postgresql-9.1 initdb
Initializing database: [ OK ]
[root@server1 yum.repos.d]#
[root@server1 yum.repos.d]# service postgresql-9.1 initdb
Initializing database: [ OK ]
[root@server1 yum.repos.d]#
安装postgresql注意事项:
(1)如果在initdb时失败,则很有可能是因为系统默认字符编码和postgresql所认可的不一致所导致的,这时可以通过/var/lib/pgsql/9.1/pgstartup.log的相关出错信息来确认
如果确定是编码的问题导致initdb失败,则可以通过在initdb时指定--no-locale来解决,具体方法如下
1.2 -bash-3.2$ /usr/local/pgsql/bin/initdb --no-locale
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale C.
The default database encoding has accordingly been set to SQL_ASCII.
The default text search configuration will be set to "english".
fixing permissions on existing directory /var/lib/pgsql/9.1/data ... ok
(2) 注意修改/var/lib/pgsql/9.1/data中的postgresql.conf和pg_hba.conf文件,根据需要配置相关的访问策略 。