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.
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 --helpDocker 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/yearningFeature 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
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architect's Guide
Dedicated to sharing programmer-architect skills—Java backend, system, microservice, and distributed architectures—to help you become a senior architect.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
