Databases 6 min read

Explore Yearning: An Open‑Source MySQL SQL Audit Platform

Yearning is an open‑source MySQL SQL audit platform that offers query auditing, workflow‑driven review, execution, rollback, fine‑grained permission control and notification integrations, with detailed installation steps and a public Gitee repository for easy deployment.

ITPUB
ITPUB
ITPUB
Explore Yearning: An Open‑Source MySQL SQL Audit Platform

Introduction

Yearning is an open‑source SQL statement audit platform for MySQL. It provides query auditing, SQL review, execution, and rollback capabilities, aiming to bridge operations and development.

Open‑source Repository

https://gitee.com/cookieYe/Yearning

Key Features

SQL query, export, auto‑completion.

Workflow‑driven SQL review, detection, execution, and rollback.

Historical audit records.

Audit query logs.

Notification via email, DingTalk webhook, robot.

Fine‑grained LDAP‑based permission management (12 independent permissions).

Modules

Dashboard : Shows user count, data source count, ticket count, query count and charts; allows password, email, real‑name changes and displays user permissions.

My Tickets : Lists tickets submitted by the user; failed or rejected tickets can be edited and resubmitted; successful tickets allow viewing rollback statements and quick SQL submission.

DDL Review : Submit DDL statements for review, view table structure and indexes, with syntax highlighting and auto‑completion.

DML Review : Submit DML statements for review, with syntax highlighting and auto‑completion.

Query : Execute and export data, with syntax highlighting, auto‑completion and fast DML submission.

Ticket Review : Administrators approve or reject DDL/DML tickets and execute them.

Query Review : Review user‑submitted queries.

Permission Review : Review user permission changes.

User Management : Create, modify, delete users.

Database Management : Add, edit, delete data sources.

User Permissions : Modify or clear individual user permissions.

Settings : Configure message push (email, DingTalk robot), LDAP, global options and switches.

Audit Rules : Define SQL detection rules.

Audit Workflow

Two‑level mode: a user submits a DDL/DML ticket, an administrator reviews and either executes or rejects it; the execution record is stored under the administrator’s account.

Multi‑level mode: after administrator approval, an executor (user with the “executor” role) performs the operation, and the execution record is stored under the executor’s account.

Installation

Yearning requires MySQL 5.7+ with a UTF‑8/UTF8mb4 database named Yearning. After creating the database, configure conf.toml:

[Mysql]
Db = "Yearning"
Host = "127.0.0.1"
Port = "3306"
Password = "xxxx"
User = "root"

[General]  # database encryption key, can be changed only once.
SecretKey = "dbcjqheupqjsuwsm"

Initialize the database:

./Yearning -m

Start the service (default or with parameters). Open a browser to the default port; the initial credentials are admin/Yearning_admin.

Conclusion

Yearning provides a functional MySQL‑only SQL audit platform that can ease collaboration between operations and development teams, though its limitation to MySQL should be considered.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

mysqlopen-sourceSQL auditDatabase ToolsYearning
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.