mysql 1524_MySQL fails on: mysql “ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded”

I got a solution!

When resetting root password at step 2), also change the auth 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;

This allowed me to log in successfully!

Full code solution

1. run bash commands

1. first, run these bash commands

sudo /etc/init.d/mysql stop # stop mysql service

sudo mysqld_safe --skip-grant-tables & # start mysql without password

# enter -> go

mysql -uroot # connect to mysql

2. then run mysql commands => copy paste this to cli manually

use mysql; # use mysql table

update user set authentication_string=PASSWORD("") where User='root'; # update password to nothing

update user set plugin="mysql_native_password" where User='root'; # set password resolving to default mechanism for root user

flush privileges;

quit;

3. run more bash commands

sudo /etc/init.d/mysql stop

sudo /etc/init.d/mysql start # reset mysql

# try login to database, just press enter at password prompt because your password is now blank

mysql -u root -p

4. Socket issue (from your comments)

When you see a socket error, a community came with 2 possible solutions:

sudo mkdir -p /var/run/mysqld; sudo chown mysql /var/run/mysqld

sudo mysqld_safe --skip-grant-tables &

(thanks to @Cerin)

Or

mkdir -p /var/run/mysqld && chown mysql:mysql /var/run/mysqld

(thanks to @Peter Dvukhrechensky)

Blind paths and possible edge errors

Use 127.0.0.1 instead of localhost

mysql -uroot # "-hlocalhost" is default

Can lead to "missing file" or slt error.

mysql -uroot -h127.0.0.1

Works better.

Skip the socket issue

I've found many ways to create mysqld.sock file, change access rights or symlink it. It was not the issue after all.

Skip the my.cnf file

The issue also was not there. If you are not sure, this might help you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Copyright (C) 1999-2016 EMS Database Management Solutions, Ltd. All rights reserved. IMPORTANT: PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE. END USER LICENSE AGREEMENT EMS Database Management Solutions, Ltd. ("EMS") agrees to provide the user ("USER") with a copy of this software product ("SOFTWARE"), and grants the USER a limited license to use the SOFTWARE. The software contains all files of the installation package except for the "Dump" folder contents. This LICENSE AGREEMENT ("LICENSE") defines what the USER may do with the SOFTWARE, and contains limitations on warranties, liabilities and remedies. This LICENSE may be revoked by EMS at any time without notice if the USER fails to comply with the terms of this LICENSE. The copyright and all other rights in the SOFTWARE shall remain with EMS. LICENSE OF SOFTWARE This LITE edition of SOFTWARE is a FREEWARE and may be used by the USER for any legal purposes for an unlimited period on unlimited number of computers without any restrictions. The LITE edition of SOFTWARE is fully functional and does NOT contain any ADWARE or SPYWARE. DISTRIBUTION OF SOFTWARE The LITE edition of SOFTWARE may be freely copied and distributed to other users without any restrictions. TERM OF LICENSE This LICENSE shall continue for as long as the USER uses the SOFTWARE and/or distributes the SOFTWARE according to the terms of this agreement. However, this LICENSE will terminate if the USER fails to comply with any of its terms or conditions. The limitations of warranties and liability set forth in this LICENSE shall continue in force even after termination. ACCEPTANCE OF THIS LICENSE AGREEMENT By downloading and/or installing this SOFTWARE, the USER agrees to the terms of this LICENSE. DISCLAIMER OF WARRANTY AND LIABILITY THE SOFTWARE AND THE ACCOMPANYING FILES ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EMS DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, LtdLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL EMS BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION OR LOSS OF BUSINESS INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE. OTHER RESTRICTIONS The USER may not rent, lease, sublicense, translate, disassemble, reverse engineer, or de-compile the SOFTWARE, or modify or merge the SOFTWARE with any part of the software in another program. This LICENSE may not be assigned or otherwise transferred without the prior written consent of EMS. The "Dump" folder contents is licensed in accordance with GNU GPL license. INVALID PROVISIONS If any provision of this LICENSE shall be declared invalid or unenforceable, the remaining provisions of this LICENSE shall remain in full force and effect to the fullest extent permitted by law. In such event, each provision of this LICENSE which is invalid or unenforceable shall be replaced with a provision as similar in terms to such invalid or unenforceable provision as may be possible which is legal and enforceable. ENTIRE AGREEMENT This LICENSE is the entire agreement between EMS and the USER, and supersedes any other agreement, oral or written, and may not be changed except by a written signed agreement.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值