earning简介
=================
Yearning MySQL 是一个SQL语句审核平台 。提供查询审计,SQL审核等多种功能,支持Mysql,可以在一定程度上解决运维与开发之间的那一环,功能丰富,代码开源,安装部署容易!
![自动补全、回滚!介绍一款可视化 sql 诊断利器](http://img.jiangsulong.com/220417/1434103a9-0.jpg)
文章插图
项目地址:
https://gitee.com/cookieYe/Ye...
注意:Yearning 1.x版本需inception提供SQL审核及回滚功能 。
Yearning 2.0开始无需依赖Inception,已自己实现了SQL审核/回滚功能
Yearning 功能介绍
================
- SQL查询
- 查询工单
- 导出
- 自动补全,智能提示
- 查询语句审计
- SQL审核
- 流程化工单
- SQL语句检测与执行
- SQL回滚
- 历史审核记录
- 推送
- E-mail工单推送
- 钉钉webhook机器人工单推送
- 用户权限及管理
- 角色划分
- 基于用户的细粒度权限
- 注册
- 其他
- todoList
- LDAP登录
- 动态审核规则配置
- AutoTask自动执行
- 仅依赖Mysql数据库 。mysql版本必须 5.7及以上版本 ,创建Yearning库字符集应为 UTF8mb4 (仅Yearning所需mysql版本)
- Yearning日志仅输出error级别,没有日志即可认为无运行错误!
- Yearning 基于1080p分辨率开发仅支持1080p及以上显示器访问
https://github.com/cookieY/Ye... 。选择你所需要下载的软件包进行下载 。
源码安装:你先需要安装一些依赖等,一些相关的安装步骤如下:
[root@test ~]# git clone https://github.com/cookieY/Yearning.git[root@test ~]# mv Yearning /usr/local/yearning[root@test ~]# cd /usr/local/yearning/[root@test yearning]# cd install/[root@test install]# lltotal 26728-rw-r--r-- 1 root root 57763 Apr 23 16:06 connections.py-rw-r--r-- 1 root root 16818 Apr 23 16:06 cursors.py-rw-r--r-- 1 root root 679 Apr 23 16:06 Docker_start.sh-rw-r--r-- 1 root root 27270656 Apr 23 16:06 inception.tar-rw-r--r-- 1 root root 11762 Apr 23 16:06 Yearning.sh[root@test install]# tar xf inception.tar[root@test install]# cd inception/bin/[root@test bin]# lltotal 12472-rw-r--r-- 1 501 games 722 Jan 3 10:39 inc.cnf-rwxr-xr-x 1 501 games 9016999 Oct 12 2017 Inception-rwxr-xr-x 1 501 games 3747312 Oct 12 2017 mysql
不过现在官方让直接下载.zip包,直接解压即可(所以这里就不建议使用源码安装了),比较方便 。mysql> create database Yearning default character set utf8mb4 collate utf8mb4_unicode_ci;Query OK, 1 row affected (0.00 sec)
mysql> show databases;+--------------------+| Database|+--------------------+| information_schema || Yearning|| mysql|| performance_schema || sys|+--------------------+5 rows in set (0.00 sec)
只需要提前安装好Mysql数据库,并按前面的要求进行配置即可 。[root@centos7-1 ~]# lltotal 14036-rw-------. 1 root root1320 Apr8 05:08 anaconda-ks.cfg-rw-r--r--1 root root 14349178 Apr 11 09:26 Yearning-2.2.0.linux-amd64.zip
上面我们直接从github上下载的最新版本2.2.0:[root@CentOS7-1 ~]# cd Yearning-go/[root@CentOS7-1 Yearning-go]# lltotal 9772-rw-r--r-- 1 root root127 Aug12019 conf.tomldrwxr-xr-x 6 root root116 Apr6 22:32 dist-rw-r--r-- 1 root root620 Jan8 21:06 docker-compose.yml-rw-r--r-- 1 root root597 Aug 212019 Dockerfile-rw-r--r-- 1 root root177 Aug 232019 # README-rwxr--r-- 1 root root 9985356 Apr6 22:35 Yearning-rw-r--r-- 1 root root283 Jan 15 03:55 yearning.service
【自动补全、回滚!介绍一款可视化 sql 诊断利器】修改配置文件vim conf.toml[Mysql]Db = "Yearning"Host = "127.0.0.1"Port = "3306"Password = "xxxx"User = "root"[General] #数据库加解密key,只可更改一次 。SecretKey = "dbcjqheupqjsuwsm"
SecretKey是token/数据库密码加密/解密的salt 。建议所有用户在初次安装Yearning之前将SecretKey更改(不更改将存在安全风险),格式: 大小写字母均可, 长度必须为16位 。特别注意:此key仅可在初次安装时更改!之后不可再次更改!如再次更改会导致之前已存放的数据源密码无法解密,最终导致无法获取相关数据源信息 。
初始化
./Yearning -m
![自动补全、回滚!介绍一款可视化 sql 诊断利器](http://img.jiangsulong.com/220417/14341013N-1.jpg)
文章插图
务必在-s启动前首先执行-m 初始化操作!如要再次初始化,需要把yearning库下所有表删除,否则重复执行无效 。
推荐阅读
- |何时是我们要毫不犹豫地选择辞职、无需思前顾后的时候?
- 汽车|上海推动工业企业复产!特斯拉、上汽即将复工
- 注意避坑!霸王条款、隐瞒车况……二手车猫腻多
- 怀疑车辆被安装GPS定位、该如何检测?
- 喝红茶、普洱会影响睡眠吗?[红茶]
- 美甲|痞幼挑战18cm美甲,挖耳勺、泡泡机成饰品,网友:上厕所咋办?
- 用Python实现十大经典排序算法-插入、选择、快速、冒泡、归并等
- 国产跑鞋买哪家?安踏、特步还是361?读完不纠结
- 普通人不得不知的15个法律常识
- 机动车、驾照迎来“3+2”新规,包括名下车牌互换,4月1日起实行