<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[跟着ArthurXF学FreeBSD19——用ports安装postgresql82]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[FreeBSD]]></category>
<pubDate>Fri, 09 Feb 2007 07:36:49 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	　　PostgreSQL是一款开源的大型数据库，有很多的大型数据库都是以它为前身发展过来的，PostgreSQL支持视图，触发器等等功能，那么就来安装最新版的PostgreSQL82吧。<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /usr/ports/databases/postgresql82-server/<br/>make<br/>make install clean</div></div><br/><br/>安装postgresql82-server会自动安装postgresql82-client的，所以不需要我们另外单独安装client了。<br/><br/>安装PostgreSQL的管理工具phppgadmin<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /usr/ports/databases/phppgadmin<br/>make install clean</div></div><br/>这是一个php写得管理PostgreSQL的工具，所以默认会安装到apache指定的web路径，一般为/usr/local/www，如果你指定其他的路径，或者想放到虚拟主机下，只需要cp phpPgAdmin整个目录到你想要防止的目录即可。<br/><br/>初始化PostgreSQL的数据库<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">su pgsql<br/>initdb -D /usr/local/pgsql/data</div></div><br/>默认数据库存放地址为/usr/local/pgsql/data，如果你不想把数据库放在这里就需要修改设置，例如：<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">mkdir /var/pgsql/data<br/>chown pgsql /var/pgsql/data<br/>#su pgsql<br/>$initdb -D /var/pgsql/data</div></div><br/><br/>su pgsql的意思是切换到用户pgsql，所以我们会看到状态符号变成了$，如果我们想返回root状态，直接使用exit命令即可。<br/><br/>下面这步很关键，要不然又要摸索很长时间了。<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">$createuser -s -P test</div></div><br/>test为你设置的使用PostgreSQL数据库的用户名和密码，我们可以设置成为用户名和密码都是test。<br/><br/>在/etc/rc.conf加入<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">#vi /etc/rc.conf<br/>postgresql_enable="YES"</div></div><br/><br/>然后启动PostgreSQL<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">#postgresql start</div></div><br/>这里特别需要注意一下，因为PostgreSQL为了安全性，所以只能通过没有特权的帐号执行start，stop等命令，当然这些我们都不需要考虑，postgresql已经都设置好了，只是像我们以前说的，你配置的环境变量如果只是配置了root，那么很可能发生切换到pgsql帐号时，Permission denied.等错误，需要到 /usr/local/pgsql，编辑.cshrc，或者把环境变量加到整个系统的配置文件中去，这样的错误就会解决得。如果你还是搞不定，那么重起肯定能搞定了。呵呵。<br/><br/>啰嗦了半天，还没完，安装好了PostgreSQL，可是查看phpinfo的时候，竟然没发现PostgreSQL，说明PostgreSQL和php还没挂接上，执行下面的操作来挂接。<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">#cd /usr/ports/databases/php5-pgsql<br/>#make<br/>#make install clean</div></div><br/>执行成功后，看phpinfo，看到pgsql项目了吧？现在已经安装好了，php也可以连接和使用PostgreSQL了，我们用phppgadmin来看看<br/>执行phppgadmin后，点击左边那个带禁止符号的PostgreSQL，右边出现了登录框，如果你没用createuser -s -P test建立用户，那么这时输入什么都登录不了，包括pgsql，这时输入我们刚建立的test和密码test，看看成功进入了吧。呵呵，管理PostgreSQL还真有点困难啊。<br/><br/><br/>现在ArthurXF本人正在搞PHP等技术培训，如果想学习的人可以跟我联系。另外培训的招生简章在这个网址，想了解的可以去看看。加我QQ：29011218交流也可。<br/><a href="http://www.bizeway.net/read.php/285.htm" target="_blank">PHP培训招生简章</a><br/>Tags - <a href="tag.php?tag=freebsd" rel="tag">freebsd</a> , <a href="tag.php?tag=postgresql82" rel="tag">postgresql82</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] 跟着ArthurXF学FreeBSD19——用ports安装postgresql82]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>