Databases 5 min read

Secure MySQL Auditing with Yearning: Open‑Source, AI‑Powered, Self‑Hosted

Yearning is an open‑source, self‑hosted MySQL audit platform that combines AI‑assisted SQL optimization, multi‑level approval workflows, automatic syntax checking, privacy protection, and flexible deployment options to help developers and DBAs secure and manage database operations.

Architect's Guide
Architect's Guide
Architect's Guide
Secure MySQL Auditing with Yearning: Open‑Source, AI‑Powered, Self‑Hosted

Yearning is a simple, efficient MySQL audit platform developed in Go under the AGPL‑3.0 license, designed to secure SQL execution in production environments.

Core Features

AI Assistant: Provides real‑time SQL optimization suggestions and natural‑language‑to‑SQL conversion.

SQL Auditing: Creates audit tickets with approval workflow, automatic syntax checks, generates rollback statements for DDL/DML, and records history.

Query Auditing: Audits user queries, restricts data sources, anonymizes sensitive fields, and stores query logs.

Check Rules: Offers multiple automatic syntax‑checking rules for common scenarios.

Privacy Protection: Self‑hosted open‑source solution with encryption to safeguard database and SQL data.

Installation & Deployment

Download the latest release, unzip, and ensure ./config.toml is configured.

Manual Installation

## Initialize database
./Yearning install

## Start Yearning
./Yearning run

## Help
./Yearning --help

Docker Deployment

## Initialize database
docker run --rm -it -p8000:8000 -e SECRET_KEY=$SECRET_KEY -e MYSQL_USER=$MYSQL_USER -e MYSQL_ADDR=$MYSQL_ADDR -e MYSQL_PASSWORD=$MYSQL_PASSWORD -e MYSQL_DB=$Yearning_DB -e Y_LANG=zh_CN yeelabs/yearning "/opt/Yearning install"

## Start Yearning
docker run -d -it -p8000:8000 -e SECRET_KEY=$SECRET_KEY -e MYSQL_USER=$MYSQL_USER -e MYSQL_ADDR=$MYSQL_ADDR -e MYSQL_PASSWORD=$MYSQL_PASSWORD -e MYSQL_DB=$Yearning_DB -e Y_LANG=zh_CN yeelabs/yearning

Feature Demonstration

AI Assistant

The AI assistant leverages large language models to suggest SQL optimizations and convert natural‑language input into SQL queries.

Automatic SQL Checker

Evaluates SQL statements against predefined rules to ensure compliance with coding standards, best practices, and security requirements.

SQL Syntax Highlighting & Autocomplete

Improves query writing efficiency by visually distinguishing keywords, tables, columns, and operators.

Order/Query Records

Audits user orders and query statements, tracking data sources, databases, and handling of sensitive fields for traceability.

Open‑Source Repository

https://github.com/cookieY/Yearning

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.

DockerMySQLSecurityAI assistantDatabase Auditing
Architect's Guide
Written by

Architect's Guide

Dedicated to sharing programmer-architect skills—Java backend, system, microservice, and distributed architectures—to help you become a senior architect.

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.