PostgreSQL数据库基本操作
其他
2018-07-21 08:34:45
阅读次数: 0
postgresql学习站点
- 创建用户
1 2 3 4 5
|
sudo -s -u postgres psql postgres# CREATE USER xxxx1 WITH PASSWORD 'xxxx'; postgres# CREATE DATABASE xxxx2; postgres# GRANT ALL PRIVILEGES ON DATABASE xxxx2 to xxxx1;
|
-
修改密码
1
|
alter user postgres with password 'foobar';
|
-
创建数据库
1 2 3 4 5
|
createdb--encoding=UTF8 --owner=foo --template=template_postgis -Ufoo 参数: --encoding=UTF8 设置数据库的字符集 --owner=foo 设置数据库的所有者 --tmplate=template_postgis 设置建库的模板,该模板支持空间数据操作 --Ufoo 用foo用户身份建立数据库 |
转载自www.cnblogs.com/LearnFromNow/p/9345420.html