【错误记录】:
ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘
【解决办法】:
// 方法一:
sudo mysql -u root -p
USE mysql;
UPDATE user SET plugin=‘mysql_native_password‘ WHERE User=‘root‘;
FLUSH PRIVILEGES;
exit;
service mysql restart
// 方法二:
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘new-password‘; // 设置自己的密码
service mysql restart
【错误记录】
MySQL fails on: mysql “ERROR 1524 (HY000): Plugin ‘auth_socket‘ is not loaded”
【解决办法】
//方法一:
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;
// 方法二:(该方法也适用于忘记密码的操作!)
sudo service mysql start
cd /var/run
sudo cp -rp ./mysqld ./mysqld.bak
sudo service mysql stop
sudo mv ./mysqld.bak ./mysqld
sudo mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root
mysql> use mysql;
mysql> update user set authentication_string=password(‘123456‘) where user=‘root‘;
mysql> flush privileges;
mysql> quit;
mysql -u root -p
mysql> update user set plugin="mysql_native_password" where User=‘root‘;
相关链接
https://*.com/questions/37879448/mysql-fails-on-mysql-error-1524-hy000-plugin-auth-socket-is-not-loaded
https://*.com/questions/37879448/mysql-fails-on-mysql-error-1524-hy000-plugin-auth-socket-is-not-loaded