Created
April 8, 2026 05:34
-
-
Save sandipklevu/a143abd3072c00f303d987141546eb3f to your computer and use it in GitHub Desktop.
Fix MySQL 8 Error ERROR 1524 (HY000): Plugin ‘auth_socket’ is not loaded in ubuntu 24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo systemctl stop mysql | |
| sudo killall -9 mysqld | |
| sudo killall -9 mysqld_safe | |
| sudo mkdir -p /var/run/mysqld | |
| sudo chown mysql:mysql /var/run/mysqld | |
| sudo mysqld_safe --skip-grant-tables --skip-networking & | |
| sleep 5 | |
| # In MySQL 8.x, we use ALTER USER or a direct UPDATE to the authentication_string | |
| mysql -u root <<EOF | |
| FLUSH PRIVILEGES; | |
| -- This sets the password to 'password' and fixes the plugin error | |
| ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; | |
| FLUSH PRIVILEGES; | |
| EOF | |
| # Clean up: Kill the safe mode process and restart normally | |
| sudo killall mysqld | |
| sleep 2 | |
| sudo systemctl start mysql | |
| echo "Process complete. Use password as password, Try logging in with: mysql -u root -p" |
sandipklevu
commented
Apr 8, 2026
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment