Skip to content

openguass

bash
export LANG=zh_CN.UTF-8

useradd guass
passwd guass   12345678

mkdir /opt/guassdb
 tar -zxvf openGauss-Lite-5.0.2-CentOS-x86_64.tar.gz -C ./guassdb/
 chown -R guass:guass  /opt/guassdb

vim /etc/selinux/config
SELINUX=disabled
 setenforce 0
swapoff -a
vim  /etc/systemd/logind.conf
RemoveIPC=no

systemctl restart systemd-logind
 vi /etc/sysctl.conf
kernel.sem = 250 32000 100 999 
sysctl -p
################
echo 12345678 | sh ./install.sh --mode single -D ~/openGauss/data -R /opt/guassdb/install  --start
### 启动数据库
./gaussdb -D /home/guass/openGauss/data --single_node
./gs_ctl start -D /home/guass/openGauss/data -Z single_node -l server.log

./gs_ctl start | stop  | restart


# 登录  1234567845
gsql -d postgres -U guass -p 5432 -h localhost

#  创建用户 指定密码
CREATE USER isoft WITH PASSWORD '12345678';
CREATE USER appview WITH PASSWORD '12345678';
gsql -d postgres -U isoft -p 5432 -h 192.168.229.130
# 授权  
GRANT ALL PRIVILEGES TO isoft;
# 授权   创建 数据库 删除数据库
GRANT CREATEDB, DROPDB TO isoft;
#  授权   创建 索引 删除索引
GRANT CREATE INDEX, DROP INDEX ON ALL TABLES IN DATABASE test TO isoft;
#  授权 允许用户查询数据库中的全部表
GRANT SELECT ON ALL TABLES IN DATABASE test TO appview;
#   授权 允许用户 crud 数据库中的全部表
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN DATABASE test TO isoft;
#  撤销授权
REVOKE ALL PRIVILEGES FROM isof;
# 创建角色
create role  isoft  IDENTIFIED  by '12345678';