Skip to content

新增支持华为 openGauss-高斯数据库开源版,高可用、高性能、高安全、高弹性、高智能、易部署、易迁移 #795

@TommyLemon

Description

@TommyLemon

Description

Image

Image

https://hub.docker.com/r/opengauss/opengauss

docker run --name opengauss --privileged=true -d -e GS_PASSWORD=openGauss@123 -p 5432:5432 opengauss/opengauss:5.0.0

docker exec -it opengauss bash

yum install json-c # 或 apt-get update && apt-get install libjson-c1

find / -name "libjson-c.so*"
ln -s /usr/lib64/libjson-c.so.5 /usr/lib64/libcjson.so.1  # 也可能是 libjson-c.so.4 或其它版本,根据上个命令查看
ldconfig

export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH
export PATH=/usr/local/opengauss/bin:$PATH

gsql -d postgres -U opengauss -W 'openGauss@123' -h localhost -p 5432

CREATE USER postgres WITH PASSWORD 'openGauss@123';
GRANT ALL PRIVILEGES ON DATABASE postgres TO postgres;

新开命令行终端窗口:

docker exec -it opengauss bash

yum install json-c # 或 apt-get update && apt-get install libjson-c1

find / -name "libjson-c.so*"
ln -s /usr/lib64/libjson-c.so.5 /usr/lib64/libcjson.so.1  # 也可能是 libjson-c.so.4 或其它版本,根据上个命令查看
ldconfig

export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH
export PATH=/usr/local/opengauss/bin:$PATH

gsql -d postgres -U postgres -W 'openGauss@123' -h localhost -p 5432

GRANT ALL PRIVILEGES ON DATABASE postgres TO postgres;
\c postgres;
create schema sys;
SET search_path TO sys, public;

GRANT USAGE ON SCHEMA sys TO postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA sys GRANT SELECT ON TABLES TO postgres;

导入 APIJSON-Demo/PostgreSQL 目录下的 apijson_uesr, Comment 等表

https://mvnrepository.com/artifact/org.opengauss/opengauss-jdbc/6.0.0-og

<dependency>
    <groupId>org.opengauss</groupId>
    <artifactId>opengauss-jdbc</artifactId>
    <version>6.0.0-og</version>
</dependency>

https://docs.opengauss.org/en/docs/latest/docs/GettingStarted/installation.html#Preparing-Installation.html
https://docs.opengauss.org/en/docs/latest/docs/GettingStarted/gsql-connection-and-usage.html
https://docs.opengauss.org/en/docs/latest/docs/DeveloperGuide/jdbc-package-driver-class-and-environment-class.html
https://docs.opengauss.org/en/docs/latest/docs/DeveloperGuide/connecting-to-a-database-JDBC.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions