今天再次要用POSTGRESQL 。索性系统的整理一下有关POSTgreSQL 的资料。
http://www.pgsqldb.org/mwiki/index.php PostgreSQL CHINA
安装
========
测试环境:Ubuntu 8.04
在Ubuntu下安装Postgresql和pgAdmin3
sudo apt-get install postgresql-8.3 postgresql-client-8.3 postgresql-contrib-8.3
sudo apt-get install pgadmin3
以上指令安装客户端和服务端,一些额外的工具、pgAdmin3都可以工作在数据库下工作。
配置Postgresql
现在我们需要重置“postgres”用户的密码。
sudo su postgres -c psql template1
template1=# ALTER USER postgres WITH PASSWORD ‘jaypei’;
template1=# \q
template1=# ALTER USER postgres WITH PASSWORD ‘jaypei’;
template1=# \q
这样就修改了数据库中的密码,现在我们也需要在unix用户“postgres”这么作。
sudo passwd -d postgres
sudo su postgres -c passwd
sudo su postgres -c passwd
然后输入跟之前一样的密码。
现在,我们就可以在数据库服务器上使用psql或者pgAdmin操作数据库了。
但是若想在pgAdmin中能够更好的记录日志和监视的华,在启动pgAdmin前需要建立PostgreSQL admin pack。打开命令行。
首先,我们需要编辑postgresql.conf:
sudo gedit /etc/postgresql/8.3/main/postgresql.conf
现在,我们需要修改“连接和权限”两行。
改变行:
#listen_addresses = ‘localhost’
修改为:
listen_addresses = ‘*’
和行:
#password_encryption = on
修改为:
password_encryption = on
#listen_addresses = ‘localhost’
修改为:
listen_addresses = ‘*’
和行:
#password_encryption = on
修改为:
password_encryption = on
保存并关闭gedit。
最后一步,我们必须设置谁才可以操作数据服务器,这一切都是在pg_hba.conf中完成的。
sudo gedit /etc/postgresql/8.3/main/pg_hba.conf
把以下内容复制到pg_hba.conf底部:
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database
# super user can access the database using some other method.
# Noninteractive
# access to all databases is required during automatic maintenance
# (autovacuum, daily cronjob, replication, and similar tasks).
#
# Database administrative login by UNIX sockets
local all postgres ident sameuser
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# “local” is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Connections for all PCs on the subnet
#
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all all [ip address] [subnet mask] md5
# If you change this first entry you will need to make sure that the
# database
# super user can access the database using some other method.
# Noninteractive
# access to all databases is required during automatic maintenance
# (autovacuum, daily cronjob, replication, and similar tasks).
#
# Database administrative login by UNIX sockets
local all postgres ident sameuser
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# “local” is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Connections for all PCs on the subnet
#
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all all [ip address] [subnet mask] md5
在最后一行中,添加你的子网掩码(如255.255.255.0)和机器IP地址(如138.250.192.115). 如果要使用一个IP地址范围,只需要把最后一个数字用0替换,那么所有这个网段的IP都可以使用了。
重启服务器即可。
sudo /etc/init.d/postgresql-8.3 restart
现在可以在Ubuntu下使用PostgreSQL了。
使用命令行创建数据库
sudo -u postgres createuser -D -A -P mynewuser
sudo -u postgres createdb -O mynewuser mydatabase
sudo -u postgres createdb -O mynewuser mydatabase
发表评论
-
ILC六月十三日SQLite类库转换
2010-06-13 17:50 1031最近一直在和参数类型打交道,各种变换。方法调 ... -
开发新产品所需要的十类文档
2010-01-05 11:34 15671、产品概念文档(项目策划书) 主要 是对市场需 ... -
winrar 3.71破解方法
2009-09-18 16:26 0winrar 3.71版随便下个中文版安装。 ... -
java 学习,资料及相关概念
2009-07-31 09:50 0java:是一门语言的艺术,她讲究 ... -
LDAP Schema的概念和基本要素
2009-07-04 20:16 0Schema是LDAP的一个重要组 ... -
Twitter
2009-06-08 11:58 1029Twitter 原址http://baike.ba ... -
网络发撒肥
2009-05-19 17:57 0samba4 ,文件共享,UGI ----system-con ... -
SOAP与REST
2009-04-15 10:16 1501简单对象访问协议 ... -
Web 开发的关键要素
2009-04-14 16:00 0通常情况下,Web 开发可以概括为以下五方面内容: 表单提 ... -
工作小事
2009-03-15 17:41 0今天下午来客户,做电子方面的调研。晚上帮客户 ... -
selenium IDE
2009-03-13 13:29 0selenium IDE 一款可以录制过程的firefox 插 ... -
javascript
2009-03-11 15:45 0javascript 在 双括号中使用变量。 “我的名字叫”+ ... -
我的学习资料库
2009-03-09 18:28 741http://www.w3school.com.cn 是最 ... -
php 环境变量检测
2009-03-03 17:08 1276<?php phpinfo() ?> 以任意文件 ... -
聪明的提问方式
2009-03-03 09:08 914提问之前 在通过电邮、新闻组或者聊天室提出技术问题前,检 ... -
如何导入导出MySQL数据库----*.sql文件操作
2009-02-27 14:18 36331. 概述 MySQL数据库的导入,有两种方法: 1) 先导 ... -
从window下安装ubuntu的弊端
2009-02-26 17:40 0今天系统又蹦了,原因是我把 环境变量给改错了。结果系统 ... -
cvs
2009-02-25 15:56 794cvs svn 安装任何软件,现阅读随软件安装包里的 R ... -
mojavi
2009-02-24 11:45 0http://hi.baidu.com/mayig/blog/ ... -
软件开发 名词解释
2009-02-10 14:16 1007CVS: 协作版本系统 (C oncurrent ...
相关推荐
PostgresQL8.3 中文文档,添加了数据库复制功能的介绍
PostgreSQL 8.3 数据库文档 《数据库入门教程》 《SQL语言教程》 《数据库管理员指南》 《数据库编程接口Libpq》 《PL/pgSQL教程》 《SQL命令参考手册》 《数据库复制》 《附录》
postgresql8.3安装过程可参考 http://blog.csdn.net/zjl_1026_2001/archive/2008/03/11/2166705.aspx
PostgresQL8.3 中文文档,添加了数据库复制功能的介绍。
postgresql 8.3 中文手册
《数据库入门教程》 《SQL语言教程》 《数据库管理员指南》 《数据库编程接口Libpq》 《PL/pgSQL教程》 《SQL命令参考手册》 《数据库复制》 《附录》
postgresql-8.3 下载 。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
服务器处于没有外网的情况下,如何安装PostgreSQL,并且通过PGADMIN访问
postgresql数据库,免费下载使用
FreeBSD7 Apache2.2 PHP5 PostgreSQL8.3 Ports安装笔记
postgresql 8.3.1 source
PostgreSQL 8.3 数据库文档(含SQL教程及参考手册)
按顺序执行以下命令即可完整安装PostgreSQL所需Zlib和readline依赖: sudo dpkg -i zlib1g-dev_1.2.8.dfsg-1ubuntu1_amd64.deb sudo dpkg -i libtinfo-dev_5.9+20140118-1ubuntu1_amd64.deb sudo dpkg -i ...
jar包文件:postgresql-8.3-606.jdbc4.jar javadoc API文档文件:postgresql-8.3-606.jdbc4-javadoc.jar sources 源代码文件(若本来存在):postgresql-8.3-606.jdbc4-sources.jar 对应Maven信息: groupId:...
postgresql-8.3.11-1 for windows
postgresql-11 Ubuntu22.04离线安装包,deb格式。 执行压缩包内 install.sh 可一键安装。 适用于无互联网环境。
postgresql-8.3-607.jdbc4.jar
postgres 8.3是中文版的postgresql数据库,还附带有postgresql-8.3-603.jdbc3.jar和postgresql-8.1-404.jdbc3.jar驱动,推荐给大家使用。