数据库相关

创建数据库

[kingbase@xxx kdb]$ ./Server/bin/ksql -p 54321 -U system test
ksql (V8.0)
Type "help" for help.

test=# create database test_db with owner='system' ENCODING UTF8;
CREATE DATABASE

查看所有数据库

[kingbase@xxx kdb]$ ./Server/bin/ksql -p 54321 -U system test
ksql (V8.0)
Type "help" for help.

test=# select datname from sys_database;
  datname
-----------
 kingbase
 test
 template1
 template0
 security
 test_db
(6 rows)

用户相关

查看所有用户

[kingbase@xxx kdb]$ ./Server/bin/ksql -p 54321 -U system test
ksql (V8.0)
Type "help" for help.

test=# select * from sys_user;
 usename | usesysid | usecreatedb | usesuper | userepl | usebypassrls |  passwd  | valuntil | useconfig
---------+----------+-------------+----------+---------+--------------+----------+----------+-----------
 sao     |        9 | f           | f        | f       | f            | ******** |          |
 sso     |        8 | f           | f        | f       | f            | ******** |          |
 system  |       10 | t           | t        | t       | t            | ******** |          |
(3 rows)