CentOS7下安装openGauss数据库

系统环境:

CentOS7minimal

安装数据库软件

yum install bzip2 wget

mkdir tmp && cd tmp
wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/1.0.0/x86/openGauss-1.0.0-CentOS-64bit.tar.gz
tar xf ../openGauss-1.0.0-CentOS-64bit.tar.gz

export GS_HOME=/home/gauss/opengauss
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GS_HOME/lib
export PATH=$PATH:$GS_HOME/bin

mkdir -p $GS_HOME && cd $GS_HOME
tar xf /home/gauss/tmp/openGauss-1.0.0-CentOS-64bit.tar.bz2

初始化数据库

gs_initdb -w Aa@123456 -D /home/gauss/data --nodename='sgnode'

#修改vi /home/gauss/data/postgresql.conf 追加
listen_addresses = '*' 
local_bind_address = '0.0.0.0'
port = 5432 

#修改vi /home/gauss/data/pg_hba.conf  追加 
host    all             all             0.0.0.0/0               sha256

启动数据库

    gaussdb -D /home/gauss/data
#或
    gs_ctl start -D /home/gauss/data -l logfile

连接数据库

gsql -dpostgres -r

#修改初始化用户的密码(若需要)
postgres=#  ALTER ROLE gauss IDENTIFIED BY 'Aa@1234567' REPLACE 'Aa@123456';

#创建用户(初始化数据库的用户不能进行远程连接,需要重新创建用户)
postgres=# create user user1 with password 'Aa@123456';
postgres=# grant all PRIVILEGES to user1; 

你可能感兴趣的:(CentOS7下安装openGauss数据库)