Linux离线安装Ocenbase国产数据库

71 阅读1分钟

1、 下载ocenbase社区版tar.gz离线安装包 (OceanBase 社区版下载 - 开源数据库下载 - OceanBase 数据库下载中心)

2、 解压文件执行: tar -zxvf 压缩包名称

3、 进入文件目录:cd 文件夹名称

4、 安装数据库:sudo bin/install.sh

a) 如果报错1007则按照提示执行
echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.con
echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/nproc.conf

5、 设置环境变量:source /root/.oceanbase-all-in-one/bin/env.sh

a) 执行 which obd 和 which obclient 检测是否安装成功,如果可以找到 obd 和 obclient 则表示安装

6、 运行初始化数据库: obd demo

a) 进入数据库:obclient -h127.0.0.1 -P2881 -uroot@sys -Doceanbase -A(第一次进入数据库root默认没有密码)
b) 如果root的权限不是%而是localhost,则修改远程权限:update user set host='%' where user='root' and host='localhost' limit 1;
c) 修改root密码:ALTER USER 'root'@'localhost' IDENTIFIED BY '自己的新密码'
d) 修改root权限:grant all privileges on *.* to 'root'@'localhost' with grant option;

7、 重启:obd cluster reload demo