postgres创建用户,修改用户密码,创建数据库

2014-11-24 07:42:26 来源: 作者: 浏览: 2
postgres创建用户,修改用户密码,创建 数据库
1.创建用户
1
sudo -s -u postgres
2
psql
3
postgres# CREATE USER xxxx1 WITH PASSWORD 'xxxx';
4
postgres# CREATE DATABASE xxxx2;
5
postgres# GRANT ALL PRIVILEGES ON DATABASE xxxx2 to xxxx1;
2.修改密码
alter user postgres with password 'foobar';
3.创建数据库
1
createdb--encoding=UTF8 --owner=foo --template=template_postgis -Ufoo
参数: --encoding=UTF8 设置数据库的字符集
--owner=foo 设置数据库的所有者
--tmplate=template_postgis 设置建库的模板,该模板支持空间数据操作
--Ufoo 用foo用户身份建立数据库
-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: