1.操作系统
centos
安装包下载: https://opengauss.org/zh/download/
2.用户创建
创建用户
useradd openGauss
3.解压安装
(1)创建目录
mkdir /usr/local/openGauss
(2)解压到 /usr/local/openGauss 目录,解压命令依赖安装yum install bzip2
tar -jxf /opt/openGauss-5.0.1-CentOS-64bit.tar.bz2 -C /usr/local/openGauss
(3)赋权
chown -R openGauss:openGauss /usr/local/openGauss
(4)进入解压目录
cd /usr/local/openGauss/simpleInstall
(5)编辑/etc/sysctl.conf文件,
vim /etc/sysctl.conf
增加
kernel.sem = 250 32000 100 999
sysctl -p
(6)使用openGauss用户安装
su openGauss
sh install.sh -w openGauss@123
(-w是指初始化数据库密码password must be at least 8 character and at least three kinds)
安装执行完成后,使用ps和gs_ctl查看进程是否正常
ps ux | grep gaussdb
gs_ctl query -D /usr/local/openGauss/data/single_node
4.开启远程连接
切换openGauss用户
su openGauss
编辑参数文件
vim /usr/local/openGauss/data/single_node/postgresql.conf
修改listen_addresses,其中192.168.152.150为实际服务器IP
编辑黑白名单文件,增加 host all all 0.0.0.0/0 sha256
vim /usr/local/openGauss/data/single_node/pg_hba.conf
重启服务
gs_ctl restart -D /usr/local/openGauss/data/single_node
5.登录,新建用户密码
gsql -d postgres -p 5432
CREATE USER mesdb PASSWORD 'Gauss@123';
GRANT ALL PRIVILEGES TO mesdb;
创建数据库
CREATE DATABASE test OWNER mesdb;
新建shema
create schema test;
新建table
create TABLE test.t1 (c1 int,c2 varchar(32));
dbeaver连接数据库
6.可能出现错误
sh install.sh -w openGauss@123时出现
解决方法:vim install.sh , 删除–locale “en_US_UTF-8”