[root@ecs-c9bf script]# su - omm
[omm@ecs-c9bf ~]$ gs_om -t start Starting cluster. ========================================= ========================================= Successfully started.
[omm@ecs-c9bf ~]$ gsql -d postgres -p 26000 -r
gsql ((openGauss 1.1.0 build 290d125f) compiled at 2020-05-08 02:59:43 commit 2143 last mr 131 Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. postgres=#
postgres=# alter role omm identified by 'Bigdata@123' replace 'openGauss@123'; ALTER ROLE
postgres=# CREATE USER joe WITH PASSWORD "Bigdata@123";
CREATE ROLE
postgres=# CREATE DATABASE db_tpcc OWNER joe;
CREATE DATABASE
postgres=# \q
[omm@ecs-c9bf ~]$ gsql -d db_tpcc -p 26000 -U joe -W Bigdata@123 -r
gsql ((openGauss 1.1.0 build 290d125f) compiled at 2020-05-08 02:59:43 commit 2143 last mr 131 Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. db_tpcc=>
db_tpcc=> CREATE SCHEMA joe AUTHORIZATION joe;
CREATE SCHEMA
db_tpcc=> CREATE TABLE mytable (firstcol int); CREATE TABLE
db_tpcc=> INSERT INTO mytable values (100); 当结果显示为如下信息,则表示插入数据成功。 INSERT 0 1
db_tpcc=> SELECT * from mytable; firstcol ---------- 100 (1 row)
postgres=# \q
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70003733/viewspace-2851840/ ,如需转载,请注明出处,否则将追究法律责任。