Common SQL Errors

MySQL Error 3164: ER_AUDIT_API_ABORT - How to Fix and Prevent

Galaxy Team
August 8, 2025

The audit plugin halted the current operation because it returned an abort status to the server.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 3164 ER_AUDIT_API_ABORT?

ER_AUDIT_API_ABORT occurs when a MySQL audit plugin returns an abort status, forcibly stopping the current event. Disable or reconfigure the offending audit plugin, or adjust its callback logic to return success, to resolve the issue.

Error Highlights

Typical Error Message

ER_AUDIT_API_ABORT

Error Type

Audit Plugin Error

Language

MySQL

Symbol

This error indicates that an audit plugin terminated execution of an event. The message typically indicates the event subclass name and a numeric status value. ER_AUDIT_API_ABORT was added in 5.7.8.

Error Code

3164

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3164 ER_AUDIT_API_ABORT?

MySQL raises ER_AUDIT_API_ABORT when an installed audit plugin explicitly returns an abort status for the current event. The server immediately cancels the statement, closes the connection if needed, and surfaces the error to the client.

The error message includes the audit event subclass name and a numeric status, helping administrators locate the exact plugin callback that issued the abort.

Because audit plugins run before the operation is committed, they can stop security-sensitive actions such as schema changes, data reads, or user logins. Fixing the error is critical to restore application availability.

What Causes This Error?

The primary trigger is an audit plugin returning MYSQL_AUDIT_INTERFACE_ABORT or a non zero status in its notify function. MySQL interprets this as a hard stop.

Misconfigured policies inside commercial or custom audit plugins often block statements that match blacklist rules. Bugs in the plugin code may also mistakenly return an abort for safe events.

Running an outdated plugin binary after upgrading MySQL can cause ABI mismatches that lead to aborts on every event.

How to Fix ER_AUDIT_API_ABORT

First, identify which audit plugin generated the abort by checking the server error log and the message placeholders.

If the abort is unintended, disable the plugin temporarily: SET GLOBAL audit_log_policy = OFF or UNINSTALL PLUGIN plugin_name. Confirm the application works, then review plugin rules.

For policy based plugins, adjust filter rules to allow the blocked statement, or whitelist the involved user or database.

Recompile or upgrade the plugin so it matches the server version if ABI issues are suspected.

Common Scenarios and Solutions

Blocking DDL in production: change the plugin rule from "DROP%" to a narrower pattern and keep auditing on.

Preventing data exfiltration: keep the abort but inform developers so they know why SELECT was denied.

False positives during bulk load: temporarily set audit_log_filter.disable = 1, run the load, then re enable.

Best Practices to Avoid This Error

Test new audit rules in staging and run integration tests to ensure they do not abort legitimate workloads.

Pin plugin binaries to the same minor MySQL version and include them in your deployment pipeline.

Monitor the MySQL error log with Galaxy alerts so you can react quickly to new ER_AUDIT_API_ABORT entries.

Related Errors and Solutions

ER_AUDIT_API_DENIED (3163) - the plugin denied an event without aborting; usually fixed by adjusting policies.

ER_PLUGIN_IS_NOT_LOADED (1524) - plugin reference exists but binary is missing; reinstall the plugin.

ER_AUDIT_API_ERROR (3162) - plugin returned an unexpected error; inspect plugin code.

Common Causes

Primary Reasons

An audit plugin returns MYSQL_AUDIT_INTERFACE_ABORT in its notify callback, forcing MySQL to halt processing.

Audit rules that blacklist specific SQL patterns, users, or hosts match the running statement and intentionally trigger an abort.

Binary incompatibility between the plugin and the upgraded MySQL server causes the plugin to misbehave and return an abort for every event.

Unhandled exceptions or bugs within custom plugin code propagate as an abort status.

Related Errors

ER_AUDIT_API_DENIED (3163)

The plugin denied the event but did not abort it; the operation continues with a warning.

ER_AUDIT_API_ERROR (3162)

The plugin returned an undefined error code; usually signals a bug inside the plugin.

ER_PLUGIN_IS_NOT_LOADED (1524)

MySQL attempted to call a plugin that is not currently loaded.

FAQs

Can I disable auditing without restarting MySQL?

Yes. Use UNINSTALL PLUGIN plugin_name or SET GLOBAL audit_log_policy = OFF to turn off auditing immediately. No restart is required.

Will disabling the plugin affect replication?

Disabling an audit plugin has no impact on binary logging or replication. Only auditing actions are skipped.

Why did the error start after a minor upgrade?

The plugin binary must match the new MySQL ABI. Recompile or download a compatible release to stop aborts.

How does Galaxy help?

Galaxy surfaces audit errors in run history and error logs, so teams can detect ER_AUDIT_API_ABORT early and adjust plugin policies from the same editor.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo