Ubuntu 10 系统下postgreSQL9.0的安装及使用笔记
来源:互联网 发布:万诚网络删除帖子费用 编辑:程序博客网 时间:2024/06/18 11:29
一、安装
1.postgresql安装
apt-get install postgresql-8.3
或者
apt-get install postgresql-9.30 dbsql
--------------------------------------------------------
http://www.dctrwatson.com/2010/09/installing-postgresql-9-0-on-ubuntu-10-04/
sudo apt-get install python-software-properties
Next up is adding the backports repo and updating apt:
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
UPDATE: In the comments, Jason Froebe points out that if you already have an earlier version of PostgreSQL installed, you can just upgrade it:
sudo apt-get upgrade
Finally install postgresql-9.0:
sudo apt-get install postgresql-9.0 libpq-dev
iptables -A FORWARD -i eth1 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j DNAT --to-destination 10.0.0.80:80
iptables -A INPUT -p tcp --dport 23 -j ACCEPT
二、配置
#listen_address='localhost'改成
listen_address='*'
这就启动了监听,能够让外部程序连接进来。
其次要修改gp_hba.conf,也在/etc/postgresql/8.3/main/目录下。
我由于不需要太多的身份认证,所以把md5都改成trust。ident sameuser 也改成trust。
这样,就可以连接上了。
重启PostgreSQL的脚本是/etc/init.d/postgresql-8.3 restart.
1.测试数据库启动与否定命令是:
psql -Upostgres postgres
2.创建database的命令是
createdb -Upostgres -Eunicode databasename
databasename是数据库的名称,根据个人需要更改成子需要的名称。
3备份数据库的命令是:
pg_dump -b -c -Eunicode -o -O -Fc -Z9 -Upostgres databasename > databasename.dmp
4.恢复数据库的命令是:pg_restore -dap -i -v -c -O -Upostgres -Fc databasename.dmp
5.删除数据库的命令是:dropdb -Upostgres databasename
6.建立数据库的命令是:createdb -Eunicode -Upostgres databasename
7.修改记录的命令是:
psql database -Upostgres
update "public"."tb_apmacaddr" set "lastcomunicationtime"= '2009-08-11 19:12:29';
- Ubuntu 10 系统下postgreSQL9.0的安装及使用笔记
- ubuntu下postgreSQL9.6安装配置
- ubuntu下postgreSQL9.6安装配置
- CentOS7下使用yum安装PostgreSQL9.6
- ubuntu 下git安装及使用笔记
- ubuntu 下minicom的安装及使用
- ubuntu 下minicom的安装及使用
- ubuntu 下minicom的安装及使用
- ubuntu下minicom的安装及使用
- ubuntu下minicom的安装及使用
- ubuntu下minicom的安装及使用
- ubuntu下minicom的安装及使用
- ubuntu下minicom的安装及使用
- ubuntu下minicom的安装及使用
- ubuntu下minicom的安装及使用
- Ubuntu下sqlite3的安装及使用
- ubuntu下minicom的安装及使用
- ubuntu下minicom的安装及使用
- mysql数据库备份与恢复命令集合
- ACTION_VIEW动作所有使用的URI示例
- Ubuntu 下svn安装及相关配置
- Ubuntu下ftp安装与配置
- Linux系统下硬件查看命令
- Ubuntu 10 系统下postgreSQL9.0的安装及使用笔记
- Ubuntu 下apt-get命令的相关参数
- Linux系统下常用命令及快捷操作
- Iptables配置与查看
- ffmpeg在android下编译的方法
- SQLite数据库建立及相关操作
- Android自定义组件view 温度计
- Java过滤特殊字符的正则表达式
- 使用VideoView播放rtsp视频流