金仓数据库-常用命令
原创
©著作权归作者所有:来自51CTO博客作者郑阳sunior的原创作品,请联系作者获取转载授权,否则将追究法律责任
数据库相关
创建数据库
[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)