How to Fix MySQL Error 1620 (WARN_PLUGIN_BUSY)

Published
Length
3 min read

Luis Felipe Dias

All posts

You see mysql error 1620 when you try to remove a busy database plugin. To fix it, close active user sessions that use the plugin or restart the server. The database returns the message that the plugin is busy and will leave on shutdown. The system uses the symbol WARN_PLUGIN_BUSY and SQLSTATE HY000 for this warning. It tells you that the database cannot unload the shared library right now. Active threads or open tables still depend on that plugin code. The server waits until all threads releas

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You see mysql error 1620 when you try to remove a busy database plugin. To fix it, close active user sessions that use the plugin or restart the server.

The database returns the message that the plugin is busy and will leave on shutdown. The system uses the symbol WARN_PLUGIN_BUSY and SQLSTATE HY000 for this warning. It tells you that the database cannot unload the shared library right now. Active threads or open tables still depend on that plugin code. The server waits until all threads release the plugin before it deletes it.

Root causes of mysql error 1620 in database servers

MySQL uses a counter to track how many threads use each loaded plugin. Each time a session uses a plugin, the server adds one to that count. When a session ends or finishes its query, the server lowers the count. If you ask the server to remove a plugin, it checks this number first. If the number is above zero, the database triggers mysql error 1620.

Storage engine plugins trigger this warning when open tables still use that engine. Even if no query runs, the table cache can hold a lock on the engine. Log in plugins also stay busy as long as those user accounts stay connected. Audit plugins and password check plugins often run on every active client thread. Background replication threads or scheduled jobs can also hold a plugin open for days.

When this warning fires, the server marks the plugin for removal later. New sessions cannot start using the plugin once it enters this state. Still, the plugin code stays in memory until the last thread lets it go. If a thread never closes, the plugin remains until the next server shutdown.

How to diagnose and fix WARN_PLUGIN_BUSY in production

First, check the system plugin table to see the status of your plugins. A busy plugin will show a deleting status instead of an active status. Next, inspect the process list to see which user sessions are still running. Look for long queries, idle transactions, or background workers that started before your command.

If you are removing a storage engine, check for open tables in the cache. Flushing the database tables forces the server to close unused table handles right away. Once the table cache drops its reference, the storage engine can unload cleanly.

MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

For log in or audit plugins, ask apps to cycle their database pools. When old client sessions close and new ones open, the reference count drops to zero. Do not kill active write threads or turn off safety checks to rush this step. Wait for transactions to finish, or plan a clean database restart during low traffic.

Preventing plugin locks during routine database changes

Removing a plugin is a major change that needs good planning and strict rules. Only senior database admins should have the role needed to add or drop plugins. Giving broad admin rights to every app account increases the risk of accidental changes. Teams should also track which apps and accounts depend on custom plugins before maintenance.

Before you run the removal command, drain traffic from the target database node. If you use read replicas, shift read queries to another node first. Then close idle sessions and flush open tables so the reference count hits zero. This simple step lets the database unload the plugin right away without a restart.

You should also review your startup settings after you remove any plugin. If the startup file still lists the plugin, the server will load it again later. Update your server settings file so the plugin stays off after the next reboot. Good change logs help your team see who changed plugin settings and when.

Inspect every MySQL query and response in flight

Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.

First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.

Frequently asked questions

Does mysql error 1620 mean the plugin removal failed?

No, it is a warning that the removal is waiting on active threads. The server marks the plugin for deletion and finishes the job on shutdown.

How can I clear a busy plugin without restarting the database?

Find and close all user sessions that use the plugin, then flush open tables. Once the usage count reaches zero, the server unloads the plugin right away.

What SQLSTATE code comes with WARN_PLUGIN_BUSY?

This warning returns the general SQLSTATE code HY000 along with error number 1620. The message states that the plugin is busy and will uninstall on shutdown.

The query runs. The emails stay hidden.