ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxÏÂÊÖ¶¯°²×°postgresql

·¢²¼Ê±¼ä:2006-10-08 00:43:37À´Ô´:ºìÁª×÷Õß:Ííµã
linuxÏ´ó¼Ò°²×°postgresqlʱ¹À¼Æ¶¼ÊÇÒÔϵͳĬÈÏ°²×°Îª×¼(ÕâÖ»ÊDz²â,²»ÒªÂîÎÒ),ÕâÑùºÜ¶à¶«Î÷ÎÒÃǶ¼²»Ã÷°×,Ò»µ«³öÎÊÌâÁ˾Ͳ»ÖªµÀÈçºÎÈ¥½â¾ö!
ÏÂÃæÎÒ¾ÍÎÒ×Ô¼ºÔÚcentOS4.3Ï´ÓÔ´Âë°²×°postgresqlÓëÅäÖÃËüµÄ²½ÖèÒ»Ò»¼Ç¼ÏÂÀ´,Óë´ó¼ÒÒ»Æð·ÖÏí.
1:´Óhttp://www.postgresql.orgÏÂÔØposgtgresqlÔ´Âë°ü.ÎÒϵÄʱ8.1.4°æ±¾µÄ.
µÃµ½postgresql-8.1.4.tar.gzÎļþ.
2:½âѹ´ËÎļþ
tar -zxf postgresql-8.1.4.tar.gz
3:ÔËÈë½âѹºóµÄÎļþ¼Ð
cd postgresql-8.1.4
4:ÅäÖÃ
./configure --prefix=PREFIX
ÆäÖÐPREFIXÊÇÄãÒª°²×°postgresqlµÄ·¾¶
5:±àÒë
gmake

£¨Ò»¶¨Òª¼ÇµÃÓà GNU make¡££© ÒÀÄãµÄÓ²¼þ¶øÒ죬ÖÆ×÷¹ý³Ì¿ÉÄÜÐèÒª 5 ·ÖÖÓµ½°ëСʱ¡£ÏÔʾµÄ×îºóÒ»ÐÐÓ¦¸ÃÊÇ


All of PostgreSQL is successfully made. Ready to install.


6:°²×°

gmake install

7:°²×°ºóÉèÖÃ( Òª×öÕâЩÊÂÇ飬°ÑÏÂÃ漸Ðмӵ½ÄãµÄ shell Æô¶¯Îļþ£¬Èç ~/.bash_profile £¨»ò /etc/profile--Èç¹ûÄãÏëÓ°ÏìËùÓÐÓû§£©)

7.1:¹²Ïí¿â

ÉèÖù²Ïí¿âµÄËÑË÷·¾¶µÄ·½·¨Òòƽ̨¶øÒ죬 µ«ÊÇ×î¹ã·ºÊ¹Óõķ½·¨ÊÇÉèÖû·¾³±äÁ¿ LD_LIBRARY_PATH Èç:

LD_LIBRARY_PATH=°²×°Â·¾¶/libexport LD_LIBRARY_PATH7.2:»·¾³±äÁ¿Ñϸñ˵£¬ÕâЩ¶¼²»ÊDZØÐëµÄ£¬µ«Õâô×ö¿ÉÒÔÈÃÄãʹÓÃPostgreSQL¸ü·½±ã¡£°²×°Â·¾¶/bin:$PATHexport PATHΪÁËÈÃÄãµÄϵͳÕҵõ½ man£¨ÊֲᣩÎĵµ£¬ÄãÐèÒª¼ÓÀàËÆÏÂÃæµÄÒ»Ðе½Ò»¸öshellÆô¶¯ÎļþÀ³ý·ÇÄã°²×°µ½ÁËȱʡʱËÑË÷µÄλÖã©£ºMANPATH=°²×°Â·¾¶/man:$MANPATHexport MANPATH 8:ʹÓÃpostgresql8.1:postgresqlÓû§ÕË»§
ºÍ´óÁ¿ÆäËü¿ÉÒÔ´ÓÍâ½ç·ÃÎʵķþÎñÆ÷ÊØ»¤½ø³ÌÒ»Ñù£¬ ÎÒÃÇÒ²½¨ÒéÓÃÒ»¸ö¶ÀÁ¢µÄÓû§ÕÊ»§ÔËÐÐPostgreSQL¡£ Õâ¸öÓû§ÕÊ»§Ó¦¸ÃÓµÓÐÓÉÕâ¸ö·þÎñÆ÷¹ÜÀíµÄÊý¾Ý£¬¶øÇÒ²»Ó¦¸ÃÓëÆäËûÊØ»¤½ø³Ì¹²ÏíÕâЩÊý¾Ý¡£ £¨±ÈÈ磬ÓÃnobody Óû§ÊǸöÀÃÖ÷Òâ¡££© ÎÒÃDz»½¨Òé°Ñ¿ÉÖ´ÐÐÎļþ°²×°ÎªÓÉ´ËÓû§ËùÓУ¬ ÒòΪÕâÑùÒ»À´±»¹¥ÆƵÄϵͳ¾Í¿ÉÒÔÐÞ¸ÄËüÃÇ×Ô¼ºÓµÓеĶþ½øÖÆÎļþ¡£

ÒªÏòÄãµÄϵͳÀïÔö¼ÓÓû§ÕÊ»§£¬²Î¿¼ÃüÁî useradd »ò adduser¡£ ÎÒÃǾ­³£Ê¹Óà postgres µÄÓû§Ãû£¬²¢ÇÒÔÚ±¾ÊéÖж¼¼ÙÉèÕâ¸öÃû×Ö£¬µ«Äã²»±ØÕâô×ö¡£


8.2:´´½¨Êý¾Ý¿â¼¯Èº

ÓÃÎļþϵͳµÄÊõÓïÀ´Ëµ£¬Ò»¸öÊý¾Ý¿â¼¯Èº½«ÊÇÒ»¸öĿ¼£¬ËùÓÐÊý¾Ý¶¼½«´æ·ÅÔÚÕâ¸öĿ¼ÖС£ ÎÒÃÇ°ÑËü³Æ×öÊý¾ÝĿ¼»òÊý¾ÝÇø¡£ ÔÚÄÄÀï´æ·ÅÊý¾ÝÍêÈ«ÊÇÄãµÄÑ¡Ôñ£¬ÎÒÃÇûÓÐȱʡֵ£¬¾¡¹Ü /usr/local/pgsql/data »ò /var/lib/pgsql/data ÕâÑùµÄĿ¼ºÜ³£ÓᣠҪ³õʼ»¯Ò»¸öÊý¾Ý¿â¼¯Èº£¬¿ÉÒÔʹÓÃÃüÁî initdb£¬ Õâ¸öÃüÁîÓë PostgreSQL Ò»Æð°²×°¡£Äã¿ÉÒÔÓÃ-D ±êʶÄãΪÄãµÄÊý¾Ý¿âϵͳѡÔñµÄÎļþϵͳλÖã¬ÀýÈ磺

$ °²×°Â·¾¶/bin/initdb -D /usr/local/pgsql/data
Çë×¢ÒâÄã±ØÐëÒÔPostgreSQLÓû§µÄÉí·ÝÀ´Ö´ÐÐÕâÌõÃüÁ ÕâÒ»µãÎÒÃÇÔÚÇ°ÃæÒ»½ÚÃèÊö¹ý¡£

Ìáʾ: ×÷Ϊ -DÑ¡ÏîµÄÌæ´úÆ·£¬Ä㻹¿ÉÒÔʹÓû·¾³±äÁ¿ PGDATA¡£

Èç¹ûÄãÉùÃ÷µÄ·¾¶»¹²»´æÔÚ£¬initdb ½«ÊÔͼ´´½¨Ëü¡£ ÄãºÜÓпÉÄÜȱÉÙ×öÕâЩÊÂÇéµÄȨÏÞ£¨Èç¹ûÄã°´ÕÕÎÒÃǵĽ¨Òé´´½¨ÁËÒ»¸ö·ÇÌØȨÕÊ»§µÄ»°£©¡£ Õâʱ£¬Äã¿ÉÒÔ×Ô¼º´´½¨¸ÃĿ¼£¨ÒÔrootÉí·Ý£©È»ºó°Ñ¸ÃĿ¼µÄËùÓÐȨ½»¸øPostgreSQLÓû§»òÕ߸³ÓëËýдȨÏÞ¡£ ÏÂÃæÊÇ¿ÉÄÜÓÐЧµÄ·½·¨£º

root# mkdir /usr/local/pgsql/dataroot# chown postgres /usr/local/pgsql/dataroot# su postgrespostgres$ °²×°Â·¾¶/bin/initdb -D /usr/local/pgsql/data

Èç¹ûÊý¾ÝĿ¼¿´ÆðÀ´ÏóÒѾ­³õʼ»¯¹ýÁË£¬ÄÇô initdb »á¾Ü¾øÔËÐС£

ÒòΪÊý¾ÝĿ¼°üº¬ËùÓд洢ÔÚÊý¾Ý¿âÀïµÄÊý¾Ý£¬ËùÒÔ³öÓÚ°²È«¿¼ÂÇ£¬Õâ¸öĿ¼²»ÄܸøÈκηÇÊÚȨÓû§·ÃÎÊ¡£Òò´Ë£¬ initdb ½ûÖ¹³ý PostgreSQL Óû§ÕÊ»§ÒÔÍâµÄÈκÎÓû§·ÃÎÊÕâ¸öĿ¼¡£

8.3:Æô¶¯ÓëÍ£Ö¹Êý¾Ý¿â·þÎñ

Æô¶¯:°²×°Â·¾¶/bin/pg_ctl -D /usr/local/pgsql/data start

Í£Ö¹:°²×°Â·¾¶/bin/pg_ctl -D /usr/local/pgsql/data stop8.4:¿Í»§¶ËÁ¬½ÓÎÊÌâpostgresqlĬÈÏÇé¿öϳý±¾»úÍâµÄ»úÆ÷ÊDz»ÄÜÁ¬½ÓµÄ,ÇÒ±¾»úµÄÁ¬½ÓÊÇÐÅÈÎÁ¬½Ó,Ö»ÒªÓÐÓû§Ãû¾Í¿ÉÒÔÁ¬½Ó,²»ÓÃÃÜÂë. Òª¸Ä±äÕâÖÖĬÈÏÉèÖÃÐèÒª¸ü¸ÄpostgresqlµÄÁ½¸öÅäÖÃÎļþ(pg_hba.confÓëpostgresql.conf,ÕâÁ½¸öÎļþÔÚinitdbʱָ¶¨µÄĿ¼ÏÂ,Èç:/usr/local/pgsql/data)8.4.1:pg_hba.confÎļþÄÚÈÝ:
Îļþ pg_hba.conf µÄ³£ÓøñʽÊÇÒ»Ì׼Ǽ£¬ ÿÐÐÒ»Ìõ¡£¿Õ°×ÐÐÐб»ºöÂÔ£¬¾®ºÅ£¨ # £©¿ªÍ·µÄ×¢ÊÍÒ²±»ºöÂÔ¡£ Ò»Ìõ¼Ç¼ÊÇÓÉÈô¸ÉÓÿոñºÍ/»ò tab ·Ö¸ôµÄ×Ö¶Î×é³É¡£ Èç¹û×Ö¶ÎÓÃÒýºÅ°üΧ£¬ÄÇôËü¿ÉÒÔ°üº¬¿Õ°×¡£¼Ç¼²»ÄÜ¿çÐдæÔÚ¡£

ÿÌõ¼Ç¼ÉùÃ÷Ò»ÖÖÁª½ÓÀàÐÍ£¬Ò»¸ö¿Í»§¶Ë IP µØÖ··¶Î§£¨Èç¹ûºÍÁª½ÓÀàÐÍÏà¹ØµÄ»°£©£¬Ò»¸öÊý¾Ý¿âÃû£¬Ò»¸öÓû§Ãû×Ö£¬ ÒÔ¼°¶ÔÆ¥ÅäÕâЩ²ÎÊýµÄÁª½ÓʹÓõÄÈÏÖ¤·½·¨¡£ µÚÒ»ÌõÆ¥ÅäÁª½ÓÀàÐÍ£¬¿Í»§¶ËµØÖ·ºÍÁª½ÓÆóͼÇëÇóµÄÊý¾Ý¿âÃûºÍÓû§ÃûµÄ¼Ç¼½«ÓÃÓÚÖ´ÐÐÈÏÖ¤¡£ Õâ¸ö´¦Àí¹ý³ÌûÓÐ"¿çÔ½"»òÕß"»ØÍ·"µÄ˵·¨£ºÈç¹ûÑ¡ÔñÁËÒ»Ìõ¼Ç¼¶øÇÒÈÏ֤ʧ°Ü£¬ ÄÇô½«²»¿¼ÂǺóÃæµÄ¼Ç¼¡£Èç¹ûûÓÐÆ¥ÅäµÄ¼Ç¼£¬ÄÇô·ÃÎʽ«±»¾Ü¾ø¡£

ÿÌõ¼Ç¼¿ÉÒÔÏÂÃæÆßÖÖ¸ñʽ֮һ

local database user authentication-method [authentication-option]
host database user CIDR-address authentication-method[authentication-option]
hostssl database user CIDR-address authentication-method [authentication-option]
hostnossl database user CIDR-address authentication-method [authentication-option]
host database user IP-address IP-mask authentication-method [authentication-option]
hostssl database user IP-address IP-mask authentication-method [authentication-option]
hostnossl database user IP-address IP-mask authentication-method [authentication-option]
¸÷¸ö×ֶεĺ¬ÒåÈçÏ£º

local
ÕâÌõ¼Ç¼ƥÅäͨ¹ý Unix ÓòÌ×½Ó×Ö½øÐеÄÁª½ÓÆóͼ¡£ ûÓÐÕâÖÖÀàÐ͵ļǼ£¬¾Í²»ÔÊÐí Unix ÓòÌ×½Ó×ÖµÄÁª½Ó¡£

host
ÕâÌõ¼Ç¼ƥÅäͨ¹ý TCP/IP ½øÐеÄÁª½Ó³¢ÊÔ¡£ host ¼Ç¼ƥÅä SSL ºÍ·Ç SSL µÄÁ¬½ÓÇëÇó¡£

×¢Òâ: ³ý·Ç·þÎñÆ÷´øןÏÊ浀 listen_addresses ÅäÖòÎÊýÖµÆô¶¯£¬·ñÔò½«²»¿ÉÄܽøÐÐÔ¶³ÌµÄ TCP/IP Á¬½Ó£¬ ÒòΪȱʡµÄÐÐΪÊÇÖ»¼àÌý±¾µØ×Ô»·µØÖ· localhost µÄÁ¬½Ó¡£

hostssl
ÕâÌõ¼Ç¼ƥÅäʹÓà TCP/IP µÄ SSL Áª½ÓÆóͼ¡£ µ«±ØÐëÊÇʹÓà SSL ¼ÓÃܵÄÁª½Ó¡£

ҪʹÓÃÕâ¸öÑ¡ÏÖÆ×÷·þÎñÆ÷µÄʱºò±ØÐë´ò¿ª SSL Ö§³Ö¡£¶øÇÒÔÚ·þÎñÆ÷Æô¶¯µÄʱºò£¬ ±ØÐëSSLÑ¡Ïîͨ¹ýÅäÖÃÑ¡Ïîssl´ò¿ª¡£

hostnossl
Õâ¸ö¼Ç¼Óë hostssl ÓÐ×ÅÕýÏà·´µÄÂß¼­£º ËüֻƥÅäÄÇЩÔÚ TCP/IP Éϲ»Ê¹Óà SSL µÄÁ¬½ÓÇëÇó¡£

database
ÉùÃ÷¼Ç¼ËùÆ¥ÅäµÄÊý¾Ý¿â¡£Öµ all ±íÃ÷¸Ã¼Ç¼ƥÅäËùÓÐÊý¾Ý¿â£¬ Öµ sameuser±íʾÈç¹û±»ÇëÇóµÄÊý¾Ý¿âºÍÇëÇóµÄÓû§Í¬Ãû£¬ÔòÆ¥Åä¡£ samegroup ±íʾÇëÇóµÄÓû§±ØÐëÊÇÒ»¸öÓëÊý¾Ý¿âͬÃûµÄ×éÖеijÉÔ±¡£ ÔÚÆäËûÇé¿öÀÕâ¾ÍÊÇÒ»¸öÌض¨µÄ PostgreSQL µÄÃû×Ö¡£ ÎÒÃÇ¿ÉÒÔͨ¹ýÓöººÅ·Ö¸ôµÄ·½·¨ÉùÃ÷¶à¸öÊý¾Ý¿â¡£ Ò»¸ö°üº¬Êý¾Ý¿âÃûµÄÎļþ¿ÉÒÔͨ¹ý¶Ô¸ÃÎļþǰ׺ @ À´ÉùÃ÷¡£

user
ΪÕâÌõ¼Ç¼ÉùÃ÷ËùÆ¥ÅäµÄPostgreSQLÓû§¡£Öµ all ±íÃ÷ËüÆ¥ÅäÓÚËùÓÐÓû§¡£ ·ñÔò£¬Ëü¾ÍÊÇÌض¨ PostgreSQL Óû§µÄÃû×Ö¡£¶à¸öÓû§Ãû¿ÉÒÔͨ¹ýÓöººÅ·Ö¸ôµÄ·½·¨ÉùÃ÷¡£×éÃû×Ö¿ÉÒÔͨ¹ýÓà + ×ö×éÃû×Öǰ׺À´ÉùÃ÷¡£ Ò»¸ö°üº¬Óû§ÃûµÄÎļþ¿ÉÒÔͨ¹ýÔÚÎļþÃûÇ°Ãæǰ׺ @ À´ÉùÃ÷¡£¸ÃÎļþ±ØÐèºÍ pg_hba.conf ÔÚͬһ¸öĿ¼¡£

CIDR-address
ÉùÃ÷ÕâÌõ¼Ç¼ƥÅäµÄ¿Í»§¶Ë»úÆ÷µÄ IP µØÖ··¶Î§¡£Ëü°üº¬Ò»¸ö±ê×¼µÄµã·ÖÊ®½øÖÆµÄ IP µØÖ·ºÍÒ»¸ö CIDR ÑÚÂ볤¶È¡£ £¨IP µØÖ·Ö»ÄÜÓÃÊýÖµÉùÃ÷£¬²»ÄÜÓÃÓò»òÕßÖ÷»úÃû¡££© ÑÚÂ볤¶È±íʾ¿Í»§¶Ë IP µØÖ·±ØÐëÆ¥ÅäµÄ¸ßλ¶þ½øÖÆλÊý¡£ ÔÚ¸ø³öµÄ IP µØÖ·ÀÕâ¸ö³¤¶ÈµÄÓұߵĶþ½øÖÆλ±ØÐëΪÁã¡£ ÔÚ IP µØÖ·£¬/£¬ºÍ CIDR ÑÚÂ볤¶ÈÖ®¼ä²»ÄÜÓпհס£

µäÐ굀 CIDR µØÖ·ÊÇ 172.20.143.89/32£¬Õâ±íÃ÷Ò»¸öÖ÷»ú£¬ »òÕß 172.20.143.0/24 ±íʾһ¸öÍøÂç¡£ ÒªÉùÃ÷µ¥¸öÖ÷»ú£¬¸ø IPv4 µØÖ·ÉùÃ÷ CIDR ÑÚÂë 32£¬¸ø IPv6 µØÖ·ÉùÃ÷ 128¡£

ÒÔ IPv4 ¸ñʽ¸ø³öµÄ IP µØÖ·»áÆ¥ÅäÄÇЩӵÓжÔÓ¦µØÖ·µÄ IPv6 Á¬½Ó£¬±ÈÈç 127.0.0.1 ½«Æ¥Åä IPv6 µØÖ· ::ffff:127.0.0.1¡£ Ò»¸öÒÔ IPv6 ¸ñʽ¸ø³öµÄ¼Ç¼½«Ö»Æ¥Åä IPv6 Á¬½Ó£¬¼´Ê¹¶ÔÓ¦µÄµØÖ·ÔÚ IPv4-in-IPv6 ·¶Î§ÄÚ¡£Çë×¢ÒâÈç¹ûϵͳµÄ C ¿â²»Ö§³Ö IPv6 µØÖ·£¬ÄÇô IPv6 µÄ¸ñʽ½«±»¾Ü¾ø¡£

Õâ¸öÓòÖ»ÊÊÓÃÓÚ host£¬hostssl ºÍ hostnossl ¼Ç¼¡£

IP-address
IP-mask
ÕâЩ·½·¨¿ÉÒÔÓÃÓÚ×÷Ϊ CIDR-address ±íʾ·¨µÄÌæ²¹¡£ Ëü²»ÊÇÉùÃ÷ÑÚÂëµÄ³¤¶È£¬¶øÊÇÔÚÁíÍâÒ»¸ö×Ö¶ÎÀïÉùÃ÷ʵ¼ÊµÄÑÚÂë¡£ ±ÈÈ磬255.0.0.0 ±íʾ IPv4 CIDR ÑÚÂ볤¶È 8£¬¶ø 255.255.255.255 ±íʾ CIDR ÑÚÂ볤¶È 32¡£ ͬÑùµÄÆ¥ÅäÂß¼­½«ÓÃÓÚÒ»¸öµã·ÖµÄ IP-mask¡£

ÕâЩ×Ö¶ÎÖ»ÊÊÓÃÓÚ host£¬ hostssl£¬ ºÍ hostnossl ¼Ç¼¡£

authentication-method£¨ÈÏÖ¤·½·¨£©
ÉùÃ÷ͨ¹ýÕâÌõ¼Ç¼Áª½ÓµÄʱºòʹÓõÄÈÏÖ¤·½·¨¡£

trust
ÎÞÌõ¼þµØÔÊÐíÁª½Ó¡£Õâ¸ö·½·¨ÔÊÐíÈκοÉÒÔÓëPostgreSQL Êý¾Ý¿â·þÎñÆ÷Áª½ÓµÄÓû§ÒÔËûÃÇÆÚÍûµÄÈÎÒâ PostgreSQL Êý¾Ý¿âÓû§Éí·Ý½øÐÐÁª½Ó£¬¶ø²»ÐèÒª¿ÚÁî¡£

reject
Áª½ÓÎÞÌõ¼þ¾Ü¾ø¡£³£ÓÃÓÚ´ÓÒ»¸ö×éÖÐ"¹ýÂË"ijЩÖ÷»ú¡£

md5
ÒªÇó¿Í»§¶ËÌṩһ¸ö MD5 ¼ÓÃܵĿÚÁî½øÐÐÈÏÖ¤¡£

crypt
ÒªÇó¿Í»§¶ËÌṩһ¸ö crypt() ¼ÓÃܵĿÚÁîÓÃÓÚÈÏÖ¤¡£ 7.2 ÒÔÇ°µÄ¿Í»§¶ËÖ»ÄÜÖ§³Ö crypt¡£ ¶ÔÓÚ 7.2 ÒÔ¼°ÒÔºóµÄ¿Í»§¶Ë£¬ÎÒÃǽ¨ÒéʹÓà md5¡£

password
ÒªÇó¿Í»§¶ËÌṩһ¸öδ¼ÓÃܵĿÚÁî½øÐÐÈÏÖ¤¡£ ÒòΪ¿ÚÁîÊÇÒÔÃ÷ÎÄÐÎʽÔÚÍøÂçÉÏ´«µÝµÄ£¬ ËùÒÔÎÒÃDz»Ó¦¸ÃÔÚ²»°²È«µÄÍøÂçÉÏʹÓÃÕâ¸ö·½Ê½¡£

krb4
Óà Kerberos V4 ÈÏÖ¤Óû§¡£Ö»ÓÐÔÚ½øÐÐ TCP/IP Áª½ÓµÄʱºò²ÅÄÜÓá£

krb5
Óà Kerberos V5 ÈÏÖ¤Óû§¡£Ö»ÓÐÔÚ½øÐÐ TCP/IP Áª½ÓµÄʱºò²ÅÄÜÓá£

ident
»ñÈ¡¿Í»§µÄ²Ù×÷ϵͳÃû£¨¶ÔÓÚ TCP/IP Áª½Ó£¬Óû§µÄÉí·ÝÊÇͨ¹ýÓëÔËÐÐÔÚ¿Í»§¶ËÉ쵀 ident ·þÎñÆ÷Áª½Ó½øÐÐÅжϵģ¬¶ÔÓÚ±¾µØÁª½Ó£¬ËüÊÇ´Ó²Ù×÷ϵͳ»ñÈ¡µÄ¡££© È»ºó¼ì²éһϣ¬¿´¿´Óû§ÊÇ·ñÔÊÐíÒÔÒªÇóµÄÊý¾Ý¿âÓû§½øÐÐÁª½Ó£¬ ·½·¨ÊDzÎÕÕÔÚ ident ¹Ø¼ü×ÖºóÃæÉùÃ÷µÄÓ³Éä¡£

pam
ʹÓòÙ×÷ϵͳÌṩµÄ¿É²åÈëµÄÈÏ֤ģ¿é·þÎñ £¨Pluggable Authentication Modules£©


ÎÒµÄÅäÖÃʾÀýÈçÏÂ:
# ±¾»úlocalhostʹÓÃÐÅÈÎÁ¬½Ó

local all all trust
#127.0.0.1Óë192.168.1.0~254¶ÎIPµØÖ··ÃÎÊʱÐèÒª¿ÚÁîÑéÖ¤
#ÒªÈñ¾»úÍâµÄ»úÆ÷·ÃÎÊ,³ýÁËÔÚÕâÉèÖÃÍ⻹Ҫ°Ñpostgresql.conf
#ÀïµÄ¼àÌýµØÖ·ÉèÖÃΪ:listen_addresses = '*'
host all all 127.0.0.1/32 md5
host all all 192.168.1.0/24 md5

8.4.2:postgresql.confÎļþÄÚÈÝ

ΪÁËʹpostgresqlÖ§³Ötcp/ipÁ¬½Ó,ÒªÉèÖüàÌýµØÖ·ÐÐ,²Î¿¼ÄÚÈÝÈçÏÂ:

# - Connection Settings -

listen_addresses = '*'
#port = 5432
max_connections = 100

8.5:ÖØÐÂÆô¶¯·þÎñ,ÏÖÔÚµÄpostgresql¾ÍÖ§³Ötcp/ipÁ¬½ÓÁË,¾Í¿ÉÒÔÓÃpsql½øÐвâÊÔÁË.
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ