Linux下安装goInception及相关环境配置

前言

 goInception是一个集审核、执行、备份及生成回滚语句于一身的MySQL运维工具, 通过对执行SQL的语法解析,返回基于自定义规则的审核结果,并提供执行和备份及生成回滚语句的功能

GitHub https://github.com/hanchuanchuan/goInception

安装步骤

安装go环境

1. 下载源码

cd /opt
wget -c https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz

2. 解压源码

tar zxvf go1.13.4.linux-amd64.tar.gz

3. 配置环境变量

echo "export PATH=$PATH:/opt/go/bin" >> /etc/profile
source /etc/profile

4. 验证是否安装成功

go version

  有版本号出现则表示成功 ! 

 

安装goInception

1. 下载源码

  方式一 链接: https://pan.baidu.com/s/1YkMlgaBtaTQTNhHkC4KIbQ  密码: aai2   放置/opt/goInception目录下

  方式二 

cd /opt
mkdir goInception
wget -c https://github.com/hanchuanchuan/goInception/releases/download/v1.1.5/goInception-linux-amd64-v1.1.5.tar.gz

2. 解压源码

tar zxvf goInception-linux-amd64-v1.1.5.tar.gz -C /opt/goInception

3. 重命名

cd goInception/config/
mv config.toml.default config.toml

4. 修改配置

vi config.toml

  英文输入状态下 按 i 进入insert模式  修改如下配置  其他保留默认配置


# IP地址
host = "127.0.0.1"

# 端口
port = 4000

backup_host = "127.0.0.1"
backup_port = 3306
backup_user = "root"
backup_password = "newpass"

5. 启动

nohup /opt/goInception/goInception -config=/opt/goInception/config/config.toml >>/dev/null 2>1& &

6. 连接

mysql -h127.0.0.1 -P4000

7.如有断连问题 启动后运行以下命令

exit

猜你喜欢

转载自blog.csdn.net/javanbme/article/details/112607083