Software⏱️ 3 min read📅 2026-06-03

How to Fix ERROR 1524 Error – MySQL fails on: mysql "ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded"

MySQL authentication issue on Ubuntu 16.04 with PHP 7 and MySQL 5.7.

Quick Answer: The 'auth_socket' plugin is not loaded, causing the error. To fix this, enable the plugin by running the command 'sudo mysql_config --install auth_socket'. Then, restart the MySQL service to apply the changes.

MySQL fails with the error 'ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded', which affects users who try to connect to MySQL using the authentication socket method.

This issue can be frustrating, especially for developers and administrators who rely on this method for secure connections. In this guide, we will walk you through the root causes of this error and provide two primary fix methods to resolve the issue.

🔍 Why This Happens

  • The 'auth_socket' plugin is not loaded by default in MySQL 5.7, which means that the authentication socket method is not enabled. This can happen if the plugin was not installed or not enabled during the installation process.
  • Another possible reason for this error is that the socket file '/var/run/mysqld/mysqld.sock' does not exist or is not readable by the MySQL user. This can occur due to a misconfiguration of the MySQL socket file or a permissions issue.

🚀 How to Resolve This Issue

Enabling the 'auth_socket' plugin

  1. Step 1: Step 1: Open the MySQL configuration file in a text editor using the command `sudo nano /etc/mysql/my.cnf`.
  2. Step 2: Step 2: Locate the [mysqld] section and add the following line to enable the 'auth_socket' plugin: `plugin=auth_socket`. Save and close the file.
  3. Step 3: Step 3: Restart the MySQL server using the command `sudo service mysql restart` or `sudo systemctl restart mysql`.

Creating the socket file

  1. Step 1: Step 1: Create the socket file using the command `sudo touch /var/run/mysqld/mysqld.sock`.
  2. Step 2: Step 2: Change the ownership of the socket file to the MySQL user using the command `sudo chown mysql:mysql /var/run/mysqld/mysqld.sock`.
  3. Step 3: Step 3: Grant read and write permissions to the MySQL user on the socket file using the command `sudo chmod 660 /var/run/mysqld/mysqld.sock`.

🎯 Final Words

By following these steps, you should be able to resolve the 'ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded' error and establish a secure connection to MySQL using the authentication socket method.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions