当前位置:   article > 正文

PolarDB 数据库:使用polardb进行创建数据库、创建用户、授权、创建表空间、创建schema表的常用操作使用演示_grant all privileges on all tables in schema publi

grant all privileges on all tables in schema public to iuser;

进入数据库:
通过 su - 数据库对应的系统管理员 登录后,再使用 psql 命令即可进入数据库。
在这里插入图片描述
创建数据库:
create database 数据库;
在这里插入图片描述
展示数据库列表:
在这里插入图片描述
切换数据库:
\c 数据库
在这里插入图片描述
创建用户:
create user 用户名 with password '密码';
在这里插入图片描述
给用户分配权限:
grant all privileges on database 数据库 to 用户;
grant all privileges on all tables in schema public to 用户;
在这里插入图片描述
创建 schema 表:
create schema 表名;
在这里插入图片描述
在指定路径下创建表空间:
create tablespace 表空间 owner 用户 location '路径';
在这里插入图片描述
设置数据库默认表空间:
alter database 数据库 set tablespace 表空间;
在这里插入图片描述
给指定用户分配表空间的使用权限:
grant all on tablespace 表空间 to 用户;
在这里插入图片描述
更多命令可以通过 help 命令查看。
在这里插入图片描述
喜欢的点个赞❤吧!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/247896
推荐阅读
相关标签
  

闽ICP备14008679号