【国产数据库】GBase学习⑤ - gsql 客户端连接工具
gsql介绍
GBase 8c 客户端工具是gsql。类似于MySQL的mysql,Oracle的sqlplus。
gsql :客户端连接工具。为用户提供的连接到数据库并进行各种操作和调试的命令行工具。gsql提供连接、元命令等功能。
gsql使用方式
gsql -d dbname -p port <-U user_name> <-h hostip>
-d 指定要连接到的数据库名称。首次连接可以指定默认数据库postgres。
-p 指定端口号信息
-U 指定数据库用户名。缺省值为 gbase
-h 指定数据库节点所在服务器IP。缺省为当前服务器
gsql --help 查看详细参数说明
1.本地连接:
[gbase@gbase8c_2 ~]$ gsql -d postgres -p 5432
gsql ((multiple_nodes GBase8cV5 3.0.0B76 build 47948f99) compiled at 2023-02-27 16:04:20 commit 0 last mr 1232 )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
multiple_nodes 分布式
3.0.0B76 版本信息
2.远程连接
需要在服务端配置:
对于GBase 8c 分布式集群,须在读写CN上以gbase 用户执行如下命令:
gs_guc reload -Z coordinator -N all -I all -h "host all all 0.0.0.0/0 sha256"
gs_guc reload -Z coordinator -N all -I all -c "password_encryptio