今天再次要用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 1109最近一直在和参数类型打交道,各种变换。方法调 ... -
开发新产品所需要的十类文档
2010-01-05 11:34 16471、产品概念文档(项目策划书) 主要 是对市场需 ... -
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 1099Twitter 原址http://baike.ba ... -
网络发撒肥
2009-05-19 17:57 0samba4 ,文件共享,UGI ----system-con ... -
SOAP与REST
2009-04-15 10:16 1564简单对象访问协议 ... -
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 817http://www.w3school.com.cn 是最 ... -
php 环境变量检测
2009-03-03 17:08 1353<?php phpinfo() ?> 以任意文件 ... -
聪明的提问方式
2009-03-03 09:08 982提问之前 在通过电邮、新闻组或者聊天室提出技术问题前,检 ... -
如何导入导出MySQL数据库----*.sql文件操作
2009-02-27 14:18 36821. 概述 MySQL数据库的导入,有两种方法: 1) 先导 ... -
从window下安装ubuntu的弊端
2009-02-26 17:40 0今天系统又蹦了,原因是我把 环境变量给改错了。结果系统 ... -
cvs
2009-02-25 15:56 853cvs svn 安装任何软件,现阅读随软件安装包里的 R ... -
mojavi
2009-02-24 11:45 0http://hi.baidu.com/mayig/blog/ ... -
软件开发 名词解释
2009-02-10 14:16 1067CVS: 协作版本系统 (C oncurrent ...
相关推荐
在Ubuntu操作系统上安装OpenERP的过程主要包含几个步骤,包括安装、配置PostgreSQL数据库和OpenERP服务器。下面详细说明这些知识点: 1. Ubuntu软件安装方法:OpenERP作为Ubuntu 9.04系统的一个默认软件包,可通过...
- **PostgreSQL**:PostgreSQL 也是 Bugzilla 支持的数据库之一,版本需为 8.3 及以上。 - **Oracle**:Oracle 数据库也可以用作 Bugzilla 的后端存储,支持版本为 10g 及以上。 - **Web 服务器**:通常使用 ...
本脚本使用shell编写,为了在生产环境中快速...10.4、MariaDB-5.5、Percona-8.0、Percona-5.7、Percona-5.6、Percona-5.5、PostgreSQL、MongoDB)提供多个 PHP 版本(PHP-8.3、PHP-8.2、PHP-8.1、PHP-8.0、PHP-7.4、PH
数据库方面,CDH支持MySQL 5.5至5.7版本、PostgreSQL 8.3至9.6版本和Oracle 11gR2、12cR1及12.2版本。推荐使用MySQL 5.5作为默认数据库,因为它的稳定性和性能已经得到了广泛认可。 在Hadoop关键组件版本建议方面,...
3.2 Ubuntu14.04 下可能缺失的软件包 11 3.3 网页显示 node.js 方面 11 3.4 其他问题 12 3.5 通过命令行运行时的配置 12 3.5.1 –xmlrpc-port=8888 12 3.5.2 –addons-path=addons 12 3.5.3 数据库的一些配置 13 ...
13.2.8 ubuntu“模式” 216 第14章 参与开源社区 219 14.1 开始加入 219 14.2 社区讨论与工作 220 14.2.1 参与社区讨论 220 14.2.2 参与社区工作 221 14.3 提升自己 225 14.4 礼仪规范 227 14.4.1 撰写邮件的礼仪和...