Home > Database > Mysql Tutorial > Why Am I Getting 'Plugin 'auth_socket' is Not Loaded' Error When Connecting to MySQL?

Why Am I Getting 'Plugin 'auth_socket' is Not Loaded' Error When Connecting to MySQL?

Susan Sarandon
Release: 2024-11-19 03:18:02
Original
710 people have browsed it

Why Am I Getting

MySQL Plugin 'auth_socket' Loading Error

In this question, the user encountered the following error when attempting to log into MySQL using the CLI:

mysql "ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded"
Copy after login

This error indicates that the MySQL plugin responsible for socket authentication is not loaded. To resolve this issue, the user must:

Update the Auth Plugin:

While resetting the root password (step 2), the user must also modify the authentication plugin to "mysql_native_password":

use mysql;
update user set authentication_string=PASSWORD("") where User='root';
update user set plugin="mysql_native_password" where User='root';  # THIS LINE
flush privileges;
quit;
Copy after login

Additional Considerations:

  • Use 127.0.0.1 Instead of Localhost: Connecting to MySQL via "localhost" may result in file missing or script load time (SLT) errors. Instead, use "127.0.0.1".
  • Skip the Socket Issue: Creating, manipulating, or linking the mysqld.sock file was not the underlying cause of the error.
  • Skip my.cnf: The my.cnf configuration file was also not a factor in the issue.

Full Code Solution:

  1. Bash Commands:

    sudo /etc/init.d/mysql stop
    sudo mysqld_safe --skip-grant-tables &
    mysql -uroot
    Copy after login
  2. MySQL Commands:

    use mysql;
    update user set authentication_string=PASSWORD("") where User='root';
    update user set plugin="mysql_native_password" where User='root';
    flush privileges;
    quit;
    Copy after login
  3. Bash Commands (Continued):

    sudo /etc/init.d/mysql stop
    sudo /etc/init.d/mysql start
    mysql -u root -p
    Copy after login

The above is the detailed content of Why Am I Getting 'Plugin 'auth_socket' is Not Loaded' Error When Connecting to MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template