<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "在CentOS Linux上安裝PostgreSQL"]]></title>
		<link>https://forum.andowson.com/posts/list/12.page</link>
		<description><![CDATA[Latest messages posted in the topic "在CentOS Linux上安裝PostgreSQL"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>在CentOS Linux上安裝PostgreSQL</title>
				<description><![CDATA[ 安裝方式很簡單，只要Internet有通就是直接用yum安裝 
<br>
[code]yum -y install postgresql postgresql-libs postgresql-server[/code] 
<br>
沒有的話，就是把光碟片內的postgresql的三個rpm檔copy到同一個目錄下，然後下 
<br>
[code]rpm -Uvh postgresql-*.rpm[/code] 
<br>
安裝完成後需先進行第一次啟動： 
<br>
[code]service postgresql start[/code] 
<br>
沒問題的話，再把postgresql設定開機時啟動 
<br>
[code]chkconfig postgresql on[/code] 
<br>
然後修改/var/lib/pgsql/data/pg_hba.conf的設定： 
<br>
[code]# "local" is for Unix domain socket connections only 
<br>
#local all all ident sameuser 
<br>
local all all trust 
<br>
# IPv4 local connections: 
<br>
#host all all 127.0.0.1/32 ident sameuser 
<br>
host all all 127.0.0.1/32 md5[/code] 
<br>
再通知postmaster我們變動了設定即可 
<br>
[code] 
<br>
su - postgres 
<br>
pg_ctl reload[/code] 
<br>
如果還要讓其他外部機器連進來的話，修改/var/lib/pgsql/data/postgresql.conf 
<br>
PostgreSQL version 8.x 
<br>
[code]listen_addresses = '*'[/code] 
<br>
PostgreSQL version 7.x 
<br>
[code]tcpip_socket = true[/code] 
<br>
然後在/var/lib/pgsql/data/pg_hba.conf加上要連進來的主機的設定，例如讓某個class C網段的機器都可以連進來： 
<br>
[code]host all all 192.168.1.0/24 md5[/code] 
<br>
再通知postmaster我們變動了設定 
<br>
[code] 
<br>
su - postgres 
<br>
pg_ctl reload[/code] 
<br>
最後, 如果有啟用Linux內建的防火牆iptables, 還要把5432:tcp加到開放的通訊埠設定去 
<br>
setup-&gt;防火牆設定-&gt;執行工具-&gt;自訂-&gt;其他連接埠: 輸入5432:tcp 或postgres:tcp]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/177/272.page</guid>
				<link>https://forum.andowson.com/posts/preList/177/272.page</link>
				<pubDate><![CDATA[Tue, 9 Oct 2007 15:52:18]]> GMT</pubDate>
				<author><![CDATA[ andowson]]></author>
			</item>
	</channel>
</rss>