【linux】Can't connect to local MySQL server through socket和Plugin 'auth_socket' is not loaded报错

真的是一次吐血的经历,弄了两个多小时才弄好。

问题1:直接登陆root用户报错

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

【linux】Can't connect to local MySQL server through socket和Plugin 'auth_socket' is not loaded报错

解答

这个其实还有通融的方法,直接在后面添加

mysql -u root -h 127.0.0.1 -p

问题2:在上一步后还是报错

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

【linux】Can't connect to local MySQL server through socket和Plugin 'auth_socket' is not loaded报错

解答

到这里真的是吐血了

  1. 一种方式参考:https://*.com/questions/37879448/mysql-fails-on-mysql-error-1524-hy000-plugin-auth-socket-is-not-loaded
  2. 上面这个方法在我这里没有效果,继续报这个错。【linux】Can't connect to local MySQL server through socket和Plugin 'auth_socket' is not loaded报错

    解决的方法,就是绕过登陆root用户,登陆另外一个拥有很大权限的用户,来修改第一个方法提到的change the auth plugin。方法参考:https://blog.csdn.net/qq_38737992/article/details/81090373 。登陆这个用户后,修改

    update user set plugin="mysql_native_password" where User='root';
上一篇:Beego源码分析(转)


下一篇:phpstorm 报错及解决