修改了Postgresql数据库的配置文件后,怎么样才能使其生效?
下面是通过postgresql的pg_ctl工具进行操作:
关闭postgresql数据库:pg_ctl stop -m fast
启动postgresql数据库:pg_ctl start
这时,你可以通过远程主机登陆系统试一下。
至此,一个完整的postgresql数据库便安装完毕了,你可以通过远程主机以postgresql用户身份输入密码登陆postgresql了!
#####2.2 postgres常见错误说明
1.安装常见错误:
(1).
configure: error: readline library notfound
If you have readline already installed, see config.log for detailson the
failure. It is possible the compiler isnt lookingin the proper directory.
Use --without-readline to disable readlinesupport.
如果出现以上错误,说明你的系统缺少readline库,这时输入:rpm -qa | grep readline
如果提示:readline-6.0-4.el6.x86_64
那么,你的电脑缺少readline-devel库,你只要安装一下readline-devel就行了:yum -y install readline-devel
再次rpm -qa | grep readline
提示:
readline-devel-6.0-4.el6.x86_64
readline-6.0-4.el6.x86_64
说明readline-devel安装成功。
(2).
checking for inflate in -lz... no
configure: error: zlib library not found
If you have zlib already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.
出现这种错误,说明你的系统缺少zlib库,输入:rpm -qa | grep zlib,如果出现如下提示:
zlib-1.2.3-29.el6.x86_64
zlib-1.2.3-29.el6.i686
jzlib-1.0.7-7.5.el6.x86_64
则说明,你的电脑缺少zlib-devel库,安装一下即可:yum install zlib-devel;
这时,再rpm -aq | grep zlib
zlib-1.2.3-29.el6.x86_64
zlib-1.2.3-29.el6.i686
jzlib-1.0.7-7.5.el6.x86_64
zlib-devel-1.2.3-29.el6.x86_64
说明zlib-devel安装成功。如果你的系统以上库均缺失,则要全部安装。
要使Postgresql数据库的配置文件生效,您需要按照以下步骤进行操作:
pg_ctl stop -m fast
/var/lib/pgsql/{版本号}/data/postgresql.conf
找到您想要修改的配置参数,并进行相应更改。例如,如果要修改连接端口,找到以下行并更改端口号:
port = 5432
保存并关闭配置文件。
使用以下命令重新启动Postgresql数据库:
pg_ctl start
pg_ctl status
psql -c "SHOW <配置参数名称>"
将<配置参数名称>
更改为您想要查看的具体配置参数。
以上步骤应该能够使您对Postgresql数据库的配置文件进行的更改生效。如果遇到任何错误或问题,可以检查错误日志文件(通常位于/var/log/postgresql/目录下)获取更多信息。
重启一下数据库