Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Databases and Redis

MySQL ERROR 1524: the auth_socket plugin is not loaded

ErrorERROR 1524 (HY000): Plugin 'auth_socket' is not loaded

Short answer

The account is set to authenticate with auth_socket, but the server has not loaded that plugin. On MySQL, load auth_socket.so with INSTALL PLUGIN or plugin-load-add in my.cnf and restart. On MariaDB, install the plugin with INSTALL SONAME and create accounts with IDENTIFIED VIA unix_socket.

  • Applies to MySQL 8.4, MariaDB 11, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check which plugin each account uses and whether the server has auth_socket loaded.

    sudo mysql -e "SELECT user, host, plugin FROM mysql.user;"
    sudo mysql -e "SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE '%socket%';"
  2. 2Match what you see, then jump to its fix

    1. 1The plugin query returns no row, and mysql.user shows auth_socket for the accountMySQL server started without the auth_socket pluginFix
    2. 2MariaDB server, and the account was created with MySQL syntax IDENTIFIED WITH auth_socketThe server is MariaDB, where the plugin is named unix_socketFix

What does the error look like?

  • ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded

Cause 1 of 2

MySQL server started without the auth_socket plugin

1Check

The MySQL manual says auth_socket is a server-side plugin in auth_socket.so, found in the directory named by plugin_dir. It works on Linux through SO_PEERCRED.

sudo mysql -e "SHOW VARIABLES LIKE 'plugin_dir';"
# then list that directory for auth_socket.so

2Fix

Load it at runtime, which also registers it for later restarts. If you cannot log in at all, add plugin-load-add=auth_socket.so under [mysqld] in my.cnf and restart the server.

INSTALL PLUGIN auth_socket SONAME 'auth_socket.so';
-- or in my.cnf
-- [mysqld]
-- plugin-load-add=auth_socket.so

3Verify

The plugin shows as ACTIVE and the socket login works for the matching OS user.

SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE '%socket%';

Confirmed by dev.mysql.com

Did this fix it?

Cause 2 of 2

The server is MariaDB, where the plugin is named unix_socket

1Check

MariaDB documents the library as auth_socket, installed in almost all versions by default, and accounts are created with IDENTIFIED VIA unix_socket.

SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE '%socket%';

2Fix

Install the plugin if the row is missing, then create or change the account with MariaDB syntax. Do not use IDENTIFIED WITH.

INSTALL SONAME 'auth_socket';
CREATE USER username@localhost IDENTIFIED VIA unix_socket;

3Verify

Log in as the OS user that matches the account name.

mariadb -u username

Confirmed by mariadb.com

Did this fix it?

How do I stop it coming back?

  • Keep one database server family per host and write user-creation SQL for that family only.
  • After restoring a mysql.user dump from another server, run the plugin query before the first login test.
  • Keep one working admin login path open before changing authentication plugins.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.