原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。使用 Google 登录即可撰写评价。原型 · 每 30 分钟更新
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

MySQL Audit

作者:jimmyjan0824版本 0.3.3i★ 0i在你的电脑上运行
注册名称io.github.jimmyjan0824/mysql-audit

安装方法

What it does

MySQL migration and query safety review for AI agents: locks, table copies, data loss, injection.

  • Connects 在你的电脑上运行
  • Account or key No key needed
  • Category 数据库与数据集

安装

选择你使用的 AI 应用,然后复制设置。

通过 3/3 项检查 · 在你的电脑上运行 · ✓ 命令已检查 2026年11月14日

第一步:你用哪个 AI?

选择你用的应用,步骤会显示在下方。

可连接 Claude,但需要先准备

需要先在电脑上安装 Python (uv)(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用

让 AI 帮你安装

把这段话复制到 Claude 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "mysql-audit": { "command": "uvx", "args": [ "mysql-audit-ai-agent" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 uv(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    uv --version
    • 显示版本号(例如 uv …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载

    打开 uv 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version

    安装一次,所有需要 uv 的工具都能用

  2. 打开电脑版 Claude 应用的设置文件

    SettingsDeveloperEdit Config

  3. 粘贴这些设置并保存文件

    {
      "mcpServers": {
        "mysql-audit": {
          "command": "uvx",
          "args": [
            "mysql-audit-ai-agent"
          ]
        }
      }
    }
  4. 退出 Claude 再重新打开

  5. 试一试

    用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

ChatGPT 暂时无法连接 MySQL Audit

MySQL Audit 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器

你可以改用这些方式

A · 使用能连接 MySQL Audit 的应用

  • 需要先在电脑上安装 Python (uv)(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
  • 需要先在电脑上安装 Python (uv)(只需一次)
  • 需要先在电脑上安装 Python (uv)(只需一次)
  • 需要先在电脑上安装 Python (uv)(只需一次)

B · 数据库与数据集 类中能连接 ChatGPT 的其他服务器

从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的

可连接 Claude Code,但需要先准备

需要先在电脑上安装 Python (uv)(只需一次)

让 AI 帮你安装

把这段话复制到 Claude Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude Code 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):claude mcp add --scope user mysql-audit -- uvx mysql-audit-ai-agent 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 uv(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    uv --version
    • 显示版本号(例如 uv …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载

    打开 uv 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version

    安装一次,所有需要 uv 的工具都能用

  2. 打开终端

    Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell

  3. 粘贴这条命令并按 Enter

    claude mcp add --scope user mysql-audit -- uvx mysql-audit-ai-agent
  4. 在 Claude Code 中输入 /mcp

    应能看到 MySQL Audit 在列表中并显示已连接

  5. 试一试

    用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude Code 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

可连接 Cursor,但需要先准备

需要先在电脑上安装 Python (uv)(只需一次)

让 AI 帮你安装

把这段话复制到 Cursor 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Cursor 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "mysql-audit": { "command": "uvx", "args": [ "mysql-audit-ai-agent" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 uv(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    uv --version
    • 显示版本号(例如 uv …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载

    打开 uv 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version

    安装一次,所有需要 uv 的工具都能用

  2. 点击这个按钮打开 Cursor

    在 Cursor 中打开

    Cursor 会请你确认安装,点击 Install

  3. 在 Cursor 中以 Agent 模式打开 AI 聊天

  4. 试一试

    用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Cursor 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同

可连接 VS Code,但需要先准备

需要先在电脑上安装 Python (uv)(只需一次)

让 AI 帮你安装

把这段话复制到 VS Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 VS Code 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "servers": { "mysql-audit": { "type": "stdio", "command": "uvx", "args": [ "mysql-audit-ai-agent" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 uv(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    uv --version
    • 显示版本号(例如 uv …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载

    打开 uv 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version

    安装一次,所有需要 uv 的工具都能用

  2. 点击这个按钮打开 VS Code

    在 VS Code 中打开

    VS Code 会请你确认安装,点击 Install

  3. 在 VS Code 中以 Agent 模式打开 AI 聊天

  4. 试一试

    用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 VS Code 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同

其他支持 MCP 的应用(如 Windsurf、Zed、Gemini CLI)添加方式各不相同,请在应用列表中查看

查看所有支持 MCP 的应用 →

JSON 设置在下方“开发者专用”中

卡住了?问问正在用 MySQL Audit 的人💬 讨论 →
开发者专用:终端命令和 JSON 设置

安装在电脑上

Claude Code

claude mcp add --scope user mysql-audit -- uvx mysql-audit-ai-agent

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "mysql-audit": {
      "command": "uvx",
      "args": [
        "mysql-audit-ai-agent"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "mysql-audit": {
      "command": "uvx",
      "args": [
        "mysql-audit-ai-agent"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "mysql-audit": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mysql-audit-ai-agent"
      ]
    }
  }
}

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

一览

每周下载量i
64/周
许可证i
Apache-2.0
连接方式
在你的电脑上运行
最新版本i
0.3.3
发布到注册中心i
2026年10月29日
代码最后更新i
2026年10月29日
作者
jimmyjan0824
软件包
pypi: mysql-audit-ai-agent
注册状态
活跃

哪些应用可以使用它

依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。

在你的电脑上运行,适用于

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

全部应用及其优缺点 →

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月15日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 jimmyjan0824 验证,该账户拥有此仓库

  • ✓ 通过

    仍在维护

    代码最后更新于17天前

  • ✓ 通过

    有许可证

    使用 Apache-2.0

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

已公开的漏洞(OSV.dev)

尚未检查

我们检查什么 → · JSON

作者:申请重新检查或报告信息错误

讨论

提问、分享技巧或报告无法使用。按“有帮助”数量排序。

还没有帖子,欢迎第一个提问或分享。

此处内容由用户撰写,不代表 PopNx 团队。

登录后发帖

用户评价

还没有评价

登录后写评价

与“数据库与数据集”中的其他服务器比较i

  • 星标数多于此分类中其他 1197 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 1197 个服务器的 71% 更新
  • 基础检查结果等于或优于此分类中其他 1197 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

MySQL Audit 安全吗?

它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于17天前,最新版本(0.3.3)于17天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:QueryWeaver, Supabase, Neon, DBCode, Keboola MCP

功能相近的其他选择

同一分类、其他作者、命令已通过检查。官方的排在前面,再按星标排序。

如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

QueryWeaver

An MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.

作者:FalkorDB正在增长★ 109614个月前更新

在你的电脑上运行✓ falkordb.com

Supabase

MCP server for interacting with the Supabase platform

作者:supabase广泛使用↓ 24.6万/周★ 3012 整个仓库的星标前天更新

电脑或云端✓ 服务方 · supabase.com

Neon

Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.

作者:neondatabase正在增长★ 6639天前更新

在云端运行✓ 服务方 · neon.com

DBCode

Query and explore 100+ databases through your DBCode connections.

作者:dbcodeio起步阶段↓ 80/周★ 366 整个仓库的星标43天前更新

在你的电脑上运行✓ 服务方 · dbcode.io

Keboola MCP

Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...

作者:keboola正在增长↓ 1421/周★ 854天前更新

电脑或云端✓ 服务方 · keboola.com
  • QueryWeaver — 需要安装在电脑上 · 不需要密钥
  • Supabase — 云端或安装在电脑上都可以 · 需要密钥 · 在 Claude 的目录中
  • Neon — 在云端运行,无需安装 · 不需要密钥
  • DBCode — 需要安装在电脑上 · 不需要密钥
  • Keboola MCP — 云端或安装在电脑上都可以 · 不需要密钥

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

mysql_audit_ai_agent

English | 繁體中文

MySQL schema-change safety review for AI coding agents.

Before Claude Code, Cursor or another agent runs a migration, it sends the SQL to review_migration and gets back a verdict (safe / review / block) plus, for every risk, the line, what will happen in production, and a safe way to write it. The checks are deterministic rules written from DBA experience, not another LLM guess.

Status: beta. Every rule about server behavior is checked against real MySQL in CI. DBAs: try the trial kit and report wrong results.

Contents: Why · What it checks · Quick start · Use with an AI agent (MCP) · Command line · Rules · Inputs that make results exact · Pre-deploy checks · Rollbacks and backups · GitHub Action · Version and upgrades · Troubleshooting · DBA trial kit · Development

Why

AI coding agents write and run migrations quickly, but the SQL that looks correct is often the SQL that takes production down: an ALTER TABLE that silently copies a 25-million-row table and blocks writes, a column type change that forces a full rebuild, a DROP COLUMN the previous release still reads, an UPDATE without WHERE, a backfill that leaves every replica minutes behind. These are the incidents a DBA catches in review, and an agent has no DBA in the loop.

MySQL Audit puts that review in front of the agent:

  • Before it runs, not after. The agent calls the review tool before executing a migration, query or SQL-building code. On block it rewrites and reviews again.
  • Deterministic. The same SQL always gets the same verdict. Each rule that depends on server behavior is tested against real MySQL 5.7, 8.0 and 8.4 in CI.
  • Actionable. Every finding has the line, the production impact and a concrete fix (for example ALGORITHM=INSTANT, gh-ost, batching by primary key, expand and contract).
  • Local and private. It never connects to your database and runs entirely on your machine. Your SQL and data never leave it.

What it checks

  • Migrations and DDL: table copies and write locks (Online DDL ALGORITHM / LOCK), version-dependent INSTANT changes, metadata-lock pile-ups, foreign keys, unique keys, large tables, free disk for rebuilds, data loss from DROP / TRUNCATE / RENAME, missing rollbacks and backups.
  • Data changes: UPDATE / DELETE without WHERE, unbatched backfills, LIMIT without ORDER BY, statements that stop replication (sql_log_bin = 0).
  • Queries: WHERE / JOIN columns no index can use.
  • Schema design: tables without a primary key, auto-increment columns that will overflow, utf8mb3.
  • Security: SQL injection in application code (Python, JS/TS, PHP, Go, Java) and dangerous GRANTs.

It is used in three ways:

SurfaceWho uses itWhat it does
MCP serverClaude Code, Cursor, Windsurf, Claude Desktop and other agentsThe agent calls review_migration, review_query, review_code and preflight_checks on its own
mysql-audit CLIDevelopers and DBAsReview files by hand or in any CI; exit code 0 / 1 / 2
GitHub ActionTeamsReviews each pull request's migrations, annotates lines, comments, fails on block, supports DBA approval

Quick start

You need Python 3.10 or later, or uv (uv brings its own Python).

1. Review a file from the command line

pip install mysql-audit-ai-agent          # in a virtual environment

mysql-audit migration.sql

or without installing anything, with uv:

uvx --from mysql-audit-ai-agent mysql-audit migration.sql

Example output:

trial/migrations/12_drop_column.sql: BLOCK (2 statements)

line 5 [block] L07: This statement drops column coupon_code. fix: Use expand and contract: ship code that no longer uses the column or table first, take a backup, then drop it in a later release. ... line 5 [warn] L18: This migration deletes data, and the file does not say where the backup is. fix: Back up what is deleted first ... and note it in the file: -- backup: s3://bucket/orders_2026-10-28.sql.gz

2. Let your AI agent use it (Claude Code)

claude mcp add mysql-audit --scope user -- uvx mysql-audit-ai-agent@latest

From then on, Claude reviews migrations before running them. Other agents: see Use with an AI agent.

3. Review every pull request with the GitHub Action.

Use with an AI agent (MCP)

Requires uv. The server runs locally over stdio; your SQL never leaves your machine.

Claude Code

claude mcp add mysql-audit --scope user -- uvx mysql-audit-ai-agent@latest

--scope user makes it available in every project. --scope project writes it to the project's .mcp.json instead, so everyone who clones the repo gets it. Check that it is connected with claude mcp list (it should show mysql-audit ... ✓ Connected), or type /mcp inside Claude Code to see the tools. Then ask Claude to review a migration, or just let it run one: it calls review_migration on its own. Remove it with claude mcp remove mysql-audit.

`/mcp` says `Failed to reconnect to mysql-audit: ENOENT`? Claude Code cannot find the uvx command: uv is not installed, or it is installed in a folder that is not on the PATH Claude Code was started with.

which uvx                                              # where is uvx?

curl -LsSf https://astral.sh/uv/install.sh | sh # if not found: install uv, then open a new terminal claude mcp remove mysql-audit # re-add it with the full path to uvx claude mcp add mysql-audit --scope user -- "$(which uvx)" mysql-audit-ai-agent@latest claude mcp list # should show mysql-audit ... ✓ Connected

Restart Claude Code (or reconnect in /mcp) afterwards. The first start downloads the package and can take a few seconds.

Cursor, Windsurf, Claude Desktop and other MCP clients (mcp.json / claude_desktop_config.json):

{

"mcpServers": { "mysql-audit": { "command": "uvx", "args": ["mysql-audit-ai-agent@latest"] } } }

ClientConfig file
Cursor~/.cursor/mcp.json, or .cursor/mcp.json in the project
Windsurf~/.codeium/windsurf/mcp_config.json
Claude Desktop (macOS)~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop (Windows)%APPDATA%\Claude\claude_desktop_config.json

Restart the client after editing. If a desktop app reports spawn uvx ENOENT, it cannot find uvx: replace "uvx" with the full path from which uvx (Windows: where uvx).

Claude Desktop, one click: download mysql-audit.mcpb from the latest release and open it.

**Running uvx mysql-audit-ai-agent in a terminal prints nothing and seems to hang. That is

expected:** it is the MCP server, waiting for an MCP client to talk to it over stdin. Press

Ctrl+C to leave. Put the command in your client's MCP config as above, and use

mysql-audit (see Command line) to review files yourself, for example

uvx --from mysql-audit-ai-agent mysql-audit migration.sql.

Tools
ToolArgumentsReturns
review_migrationsql, optional schema, stats, mysql_version, free_disk_gb, rollback_sqlVerdict and findings for DDL, migration scripts and bulk writes
review_querysql, optional schema, stats, mysql_versionVerdict and findings for queries the application will run
review_codecodeSQL injection findings in application source
preflight_checkssql, optional mysql_versionPre-deploy SQL to run on the primary
explain_rulerule_id (e.g. L02)Why the rule matters and a safe example
list_rulesEvery rule with its id, title and default severity

Arguments the call leaves out are read from .mysql-audit.toml. Example prompts to try: "Add a nickname column to users", "Drop the note column from orders", "Check this Python for SQL injection: cur.execute(f\"... {email}\")", "Explain mysql-audit rule L03".

In our agent evaluation Claude Code called the tool on its own in 10 of 10 migration tasks, with no extra prompt.

Command line

mysql-audit [files ...] [--schema FILE] [--stats FILE] [--mysql-version VERSION]

[--free-disk-gb GB] [--config FILE] [--format text|json] [--color auto|always|never] [--code] [--preflight] [--version]

OptionMeaning
filesSQL files to review; reads stdin when omitted
--schema FILECurrent CREATE TABLE statements (e.g. mysqldump --no-data); makes column and index checks exact
--stats FILEJSON table sizes, {"orders": 25000000} or {"orders": {"rows": ..., "data_bytes": ..., "index_bytes": ...}}; enables the large-table rules
--mysql-version VTarget server, e.g. 8.0.28, 8.4.3, 5.7.44, aurora-3.04 (default: 8.0.29 or later)
--free-disk-gb GBFree space on the server's data volume; with byte sizes enables L17
--config FILESettings file (default: the nearest .mysql-audit.toml)
--format jsonMachine-readable output
`--color auto\always\never`Color text output: [block] lines red, [warn] lines yellow, the verdict red / yellow / green. auto (default) colors only on a terminal and honors NO_COLOR / FORCE_COLOR
--codeThe files are application code: check for SQL injection
--preflightPrint pre-deploy SQL for these migrations instead of reviewing them
--versionPrint the installed version

Examples:

mysql-audit db/migrate/20261027_add_index.sql --schema schema.sql --stats stats.json

mysql-audit db/migrate/*.sql --mysql-version 8.0.28 --format json echo "UPDATE users SET status = 0;" | mysql-audit # from stdin mysql-audit --code app/models/user.py # SQL injection check mysql-audit migration.sql --preflight > preflight.sql # pre-deploy checks

Exit code: 0 = safe, 1 = review, 2 = block, so it can gate any CI.

Verdicts: block means do not run it as written; review means it can run but a person should read the findings first; safe means no findings at warn level or above. Each finding has a severity (block, warn, info), a line number, the impact and a fix.

Rules

IDChecksDefaultNeeds
L01DDL without explicit ALGORITHM / LOCK; ALGORITHM=COPY, LOCK=SHARED/EXCLUSIVEwarn / block
L02Column changes that force a table copy: type change, VARCHAR shrink or crossing 255 bytes, ENUM reorder, charset conversion, dropping the PK, adding a STORED generated columnblockschema for exact answers
L03Row-touching DDL on a large table: use gh-ost / pt-online-schema-changewarnstats
L04DDL without a short SET SESSION lock_wait_timeout (metadata-lock pile-up)warn
L05ADD FOREIGN KEY while foreign_key_checks=1 (COPY only)block
L06UPDATE / DELETE / INSERT ... SELECT over a large table in one transaction (replication lag)warnstats

| L07 | DROP / TRUNCATE / RENAME of

只显示了开头部分;其余内容请在仓库中阅读