首页 > 数据库

Postgres基本命令及远程连接方案

时间:2009-06-09 14:11:48  作者:zhxue123  我要投稿
Linux初探欢迎您的投稿,投放方法请点击这里查看,我们会定期赠送精美小礼品给优秀的投稿作者。海纳百川 取则行远!LinuxGoo欢迎您的到来。
postgres的一些基本命令**************************************************./psql-U postgresSELECT datname FROM pg_database;./psqlcas_data -U postgres用......

postgres的一些基本命令

**************************************************

./psql -U postgres

SELECT datname FROM pg_database;

./psql cas_data -U postgres 用户postgres进入cas_data数据库

\dt //显示所有数据表

select * from sc_data;

**************************************************

关于postgres远程访问的问题:

***************************************************

step 1 vi ../data/pg_hba.conf ,并且做如下修改。

# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5

host all all 0.0.0.0/0 md5

step 2 重启postgres服务

su postgres

./pg_ctl stop -D ../data/ //停止服务

./pg_ctl start -D ../data/ //启动服务

***************************************************

参考文献

http://www.xxlinux.com/linux/article/development/database/20070820/9402.html postgres客户端常用命令

http://www.pgsqldb.org/mwiki/index.php/首页 postgresql中文之家

http://www.learndiary.com/archives/diaries/1856.htm 远程连接postgr

http://xinsoft.bokee.com/5374965.html 解决postgresql不能远程访问

如果您需转载 Postgres基本命令及远程连接方案,请注明来自LinuxGoo.com,其版权归原作者所有。请广大网友留言时遵纪守法,使用文明用语。如果您在应用中有什么问题,请在下面留言,我们会尽快解答。
来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
栏目热门