lightdb创建初始数据库和用户

复制代码
[root@hs-10-20-30-199 ~]# su - lightdb
Last login: Wed May 25 13:16:32 CST 2022 from 10.188.120.129 on pts/10
[lightdb@hs-10-20-30-199 ~]$ ltsql
ltsql: error: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.LIGHTDB.5432"?
[lightdb@hs-10-20-30-199 ~]$ ltsql -p8000
ltsql (13.3-22.2)
Type "help" for help.

lightdb@postgres=# create database ltdb;
NOTICE:  Canopy partially supports CREATE DATABASE for distributed databases
DETAIL:  Canopy does not propagate CREATE DATABASE command to workers
HINT:  You can manually create a database and its extensions on workers.
CREATE DATABASE
lightdb@postgres=# create user ltuser with password 'ltpwd';
NOTICE:  not propagating CREATE ROLE/USER commands to worker nodes
HINT:  Connect to worker nodes directly to manually create all necessary users and roles.
CREATE ROLE
lightdb@postgres=# alter database ltdb owner to ltuser;
ALTER DATABASE
lightdb@postgres=# exit
[lightdb@hs-10-20-30-199 ~]$ ltsql -Ultuser -p8000
ltsql (13.3-22.2)
Type "help" for help.

ltuser@postgres=> select current_user;
 current_user 
--------------
 ltuser
(1 row)
复制代码

 

posted @   zhjh256  阅读(130)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2021-05-25 centos 7安装tigervnc,最简单(亲测)
点击右上角即可分享
微信分享提示