Ubuntu安装使用系列: 安装和使用数据库系统PostgreSQL
Posted by cnruby Wed, 14 Feb 2007 09:29:00 GMT
Ubuntu安装使用系列: 目录和说明
在Ubuntu 6.0.6版本上安装和使用数据库系统PostgreSQL
- [确定软件方位]
vi /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu dapper-backports main universe multiverse restricted
apt-get update - [安装PostgreSQL数据库服务器和客户器]
apt-get install postgresql-8.1 postgresql-client-8.1 postgresql-client-common postgresql-common
apt-get install postgresql-8.2 postgresql-client-8.2 postgresql-client-common postgresql-common - [检测PostgreSQL数据库服务器]
/etc/init.d/postgresql-8.1 --help
/etc/init.d/postgresql-8.1 status - [进入和退出PostgreSQL客户器]
su postgres -c psql
\q - [修改用户"postgres"的密码]
su postgres -c psql
ALTER USER postgres WITH PASSWORD 'yourdbpassword';
\q - [在Shell上创建自己的数据库]
su postgres -c createdb yourdbname - a[简单安装PosrgreSQL的纯Ruby语言驱动器]
gem install postgres-pr -r - b[或者专业安装PosrgreSQL的Ruby语言驱动器,注意这是另一个不同的实现。]
apt-get install postgresql-dev
gem install postgres -- --with-pgsql-include=/usr/include/postgresql/ --with-pgsql-dir=/usr/lib/postgresql/8.1/lib/ - [检测PostgreSQL版本]
psql -v - [启动PostgreSQL服务器]
/etc/init.d/postgresql-8.1 start - [停止PostgreSQL服务器]
/etc/init.d/postgresql-8.1 stop - [帮助命令]
find / -name postgresql
参考资料
- http://weblogs.java.net/blog/cayhorstmann/archive/2006/07/installing_glas.html
- http://hocuspok.us/journal/postgresql-on-ubuntu-linux-how-to
- http://wiki.rubyonrails.org/rails/pages/HowToSetupDebianApache2Rails
- http://sam.aaron.name/articles/2006/11/11/rails-on-debian-on-linode-4-install-and-configure-postgresql-8-1
- http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx
- http://hocuspok.us/journal/postgresql-on-ubuntu-linux-how-to-updated
- https://wiki.ubuntu.com/UbuntuBackports
________________________________________________________________ 您只要点击下面图标,就可以把本文加入到您喜欢的公共收藏库中去。



![Validate my RSS feed [Valid RSS]](/blog1/files/valid-rss.png)




