通过 云和恩墨 发布的 Docker 镜像,可以快速的运行一个 openGauss 环境,支持我们的学习测试。
墨天轮上的朋友们已经整理了很多内容,可以参考:
opengauss docker安装 : https://www.modb.pro/db/27152
opengauss docker从环境搭建到运行: https://www.modb.pro/doc/4656
以下是云和恩墨的测试环境,同学们已经建立了大量的测试环境:
[root@ecs-514e-0004 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 029868a4ecf6 enmotech/opengauss:latest "docker-entrypoint.s…" 43 hours ago Up 43 hours 0.0.0.0:8888->5432/tcp eygle 7bf91f34b43e enmotech/opengauss:latest "docker-entrypoint.s…" 44 hours ago Up 44 hours 0.0.0.0:5555->5432/tcp opengauss5 06271f6f2002 enmotech/opengauss:latest "docker-entrypoint.s…" 44 hours ago Up 44 hours 0.0.0.0:4444->5432/tcp opengauss4 d27c6d3501cf enmotech/opengauss:latest "docker-entrypoint.s…" 44 hours ago Up 44 hours 0.0.0.0:3333->5432/tcp opengauss3 c788a9e2fc86 enmotech/opengauss:latest "docker-entrypoint.s…" 44 hours ago Up 44 hours 0.0.0.0:2222->5432/tcp opengauss2 2164d118eb70 enmotech/opengauss:latest "docker-entrypoint.s…" 44 hours ago Up 44 hours 0.0.0.0:1111->5432/tcp opengauss1
复制
连接到容器中的数据库:
[root@ecs-514e-0004 ~]# docker exec -it 029868a4ecf6 sh sh-5.0# id uid=0(root) gid=0(root) groups=0(root) sh-5.0# su - omm Last login: Sun Jul 12 10:04:02 CST 2020 on pts/0 Welcome to 4.19.90-2003.4.0.0036.oe1.aarch64 [omm@029868a4ecf6 ~]$ gsql gsql ((openGauss 1.0.0 build 38a9312a) compiled at 2020-05-27 14:57:08 commit 472 last mr 549 ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. omm=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------------------+----------- gaussdb | | {} omm | Sysadmin, Create role, Create DB, Replication, Administer audit, UseFT | {}
复制
创建一个新的用户,我们可以看到 openGauss 对于密码安全的要求:
omm=# create user enmotech with password 'enmotech'; ERROR: Password must contain at least three kinds of characters. omm=# omm=# create user enmotech with password 'Enm0t3ch'; NOTICE: The encrypted password contains MD5 ciphertext, which is not secure. CREATE ROLE
复制
创建独立的数据库,给用户授权:
omm=# create database enmotech owner enmotech; CREATE DATABASE omm=# GRANT ALL PRIVILEGES ON DATABASE enmotech to enmotech; GRANT omm=# ALTER ROLE enmotech CREATEDB; ALTER ROLE omm=# GRANT ALL PRIVILEGES TO enmotech; ALTER ROLE omm=# \q
复制
使用新的数据库用户连接:
[omm@029868a4ecf6 ~]$ gsql -U enmotech -d enmotech Password for user enmotech: gsql ((openGauss 1.0.0 build 38a9312a) compiled at 2020-05-27 14:57:08 commit 472 last mr 549 ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. enmotech=> \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------------------+----------- enmotech | Sysadmin,Create DB | {} gaussdb | | {} omm | Sysadmin, Create role, Create DB, Replication, Administer audit, UseFT | {} enmotech=>
复制
在容器外连接:
[root@ecs-514e-0004 ~]# gsql -d enmotech -U enmotech -W'Enm0t3ch' -h 192.168.1.94 -p 8888 gsql ((openGauss 1.0 build ec0e781b) compiled at 2020-04-27 17:25:57 commit 2144 last mr 131 ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. enmotech=> \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------------------+----------- enmotech | Sysadmin,Create DB | {} gaussdb | | {} omm | Sysadmin, Create role, Create DB, Replication, Administer audit, UseFT | {}
复制
体验 openGauss 之旅就可以开始了。
最后修改时间:2020-07-13 10:16:03
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
请问进入docker的密码是多少
3年前

评论
华为数据库工程师认证有培训的不
4年前

1
相关阅读
内蒙古公司成功完成新一代BOSS云原生系统割接上线
openGauss
165次阅读
2025-03-24 09:40:40
第4期 openGauss 中级认证OGCP直播班招生中!3月30日开课
墨天轮小教习
137次阅读
2025-03-17 15:48:40
【opengauss/磐维数据库】 删除用户报错
飞天
87次阅读
2025-02-26 23:23:08
openGauss HASH JOIN原理
lbsswhu
44次阅读
2025-03-18 10:45:01
民生银行测试用例参数
Cabbage
43次阅读
2025-03-05 09:35:20
从数据库源码比较 PostgreSql和OpenGauss的启动过程
maozicb
39次阅读
2025-03-24 15:55:04
安装opengauss时由于平台对password关键字审计问题,导致第二次密码输入失败。
是赐赐啊!🦄
34次阅读
2025-02-26 09:36:50
对话openGauss开发者之天津大学游奕桁
openGauss
33次阅读
2025-02-28 14:54:31
openGauss 学习之路:集群部署实战探索
openGauss
29次阅读
2025-03-21 10:34:13
对话openGauss伙伴之钉钉杨俊华
openGauss
29次阅读
2025-02-25 09:26:07