postgresql使用心得

来源:互联网 发布:fps软件下载 编辑:程序博客网 时间:2024/05/16 10:23

今天看到python使用的数据库有个叫postgresql,就想用用试下。我的是ubuntu14.04的系统。

首先安装postgresql:sudo apt-get install postgresql

然后创建‘postgres’的Linux用户等等,另外还有一些配置信息网上都有。


在shell里输命令操作,首先切换到postgres用户:su postgres

在创建用户之前要切换到其它目录,在/root目录下创建用户会得到权限不够的错误。

创建用户:createuser -s -P username;          -s:创建supperuser        -P:需要密码验证。需要改配置文件pg_hba.conf,具体在http://stackoverflow.com/questions/17443379/psql-fatal-peer-authentication-failed-for-user-dev有说明。

创建超级用户是为了导入.csv文件满足权限要求。


参考网站:

http://blog.51yip.com/pgsql/1524.html

http://www.cnblogs.com/z-sm/archive/2016/07/05/5644165.html



0 0
原创粉丝点击