Docker 安装OceanBase数据库

2022-01-03 11:03:48 9点赞 38收藏 3评论

购买理由

阿里出的数据库,一直想试用一下,按照官方出的教程安装了很多遍都没有成功,在官网查教程看视频,找了很多资料,发docker下也可以用,所以就报着试试看的心情,一试就成功了,而且可以远程连接,数据库默认密码是空的,这个有点不安全,不过也可以改。

使用感受

把安装过程分享一下,docker环境已经安装好了,centos7下安装的,不会安装的可以参考菜鸟教程安装一下,我小白都会,教程地址发一下:https://www.runoob.com/docker/docker-tutorial.html

废话不多说了,直接开始了

一、拉取镜像

[root@gobygo ~]# docker pull oceanbase/obce-mini

Using default tag: latest

latest: Pulling from oceanbase/obce-mini

13add961a70d: Pull complete

7e25e159732e: Pull complete

6387a3280aea: Pull complete

Digest: sha256:a2891f3c3235d81e797e90b370c55582af2caea5ffb11f13da59fc4e0f260e9d

Status: Downloaded newer image for oceanbase/obce-mini:latest

docker.io/oceanbase/obce-mini:latest

二、运行容器

[root@gobygo ~]# docker run -p 2881:2881 --name yang01 -e OB_ROOT_PASSWORD=yr888888 -d oceanbase/obce-mini

b0e6e2ebc1aebe4b95f17c2b86823fa73b1a09a341ed5d3867280923746e082d

[root@gobygo ~]# docker logs yang01 | tail -1 出现"boot success"表示安装成功

boot success!

查看运行的容器

[root@gobygo ~]# docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

b0e6e2ebc1ae oceanbase/obce-mini "/bin/sh -c _boot" 4 seconds ago Up 2 seconds 0.0.0.0:2881->2881/tcp, :::2881->2881/tcp yang01

也可以进入容器

[root@gobygo ~]# docker exec -it yang01 ob-mysql sys

login as root@sys

Command is: obclient -h127.1 -uroot@sys -A -Doceanbase -P2881 -pyr888888

Welcome to the OceanBase. Commands end with ; or g.

Your MySQL connection id is 3221487622

Server version: 5.7.25 OceanBase 3.1.0 (r-00672c3c730c3df6eef3b359eae548d8c2db5ea2) (Built Jun 22 2021 12:46:28)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MySQL [oceanbase]>

三、远程连接OceanBase数据库

使用Navicat Premium 连接OceanBase数据库,直接连接成功,SQL语句的使用和mysql基本类似

Docker 安装OceanBase数据库

总结

希望阿里数据库越走越远!

作者声明本文无利益相关,欢迎值友理性交流,和谐讨论~

展开 收起
3评论

  • 精彩
  • 最新
  • 感觉大妈上看这种技术类文章的人没几个啊

    校验提示文案

    提交
    nas类的很多

    校验提示文案

    提交
    收起所有回复
  • 这种太底层的技术,如果不知道能拿来干什么,确实不太会看。

    校验提示文案

    提交
提示信息

取消
确认
评论举报

相关文章推荐

更多精彩文章
更多精彩文章
最新文章 热门文章
38
扫一下,分享更方便,购买更轻松