mysql1524,MySQL不允许用户登录:错误1524

Server version: 5.7.10 MySQL Community Server (GPL)

In MySQL, I have a user mangos. The user worked perfectly when I created it. After rebooting my computer, though, attempting to login to mangos yielded this output:

$ mysql -u mangos -p

Enter password:

ERROR 1524 (HY000): Plugin '*some_random_long_hash_I_cannot_remember' is not loaded

$

It kind of reminded me of a password hash, so after investigating mysql.user, I found that mangos had no password!

I updated the password:

SET PASSWORD FOR 'mangos'@'127.0.0.1' = PASSWORD('mangos');

FLUSH PRIVILEGES;

Now, I get:

ERROR 1524 (HY000): Plugin '*3FBBDB84EA2B2A0EA599948396AD622B7FF68183' is not loaded

3FBBDB84EA2B2A0EA599948396AD622B7FF68183 is the same number shown in the password column of mysql.user for mangos, and is a different number than originally. I still can't log in.

How do I make MySQL recognize a password properly? Is that even the issue here?

Edits:

mysql> SELECT * FROM mysql.user WHERE user = 'mangos' \G

*************************** 1. row ***************************

Host: localhost

User: mangos

Password: *3FBBDB84EA2B2A0EA599948396AD622B7FF68183

Select_priv: N

Insert_priv: N

Update_priv: N

Delete_priv: N

Create_priv: N

Drop_priv: N

Reload_priv: N

Shutdown_priv: N

Process_priv: N

File_priv: N

Grant_priv: N

References_priv: N

Index_priv: N

Alter_priv: N

Show_db_priv: N

Super_priv: N

Create_tmp_table_priv: N

Lock_tables_priv: N

Execute_priv: N

Repl_slave_priv: N

Repl_client_priv: N

Create_view_priv: N

Show_view_priv: N

Create_routine_priv: N

Alter_routine_priv: N

Create_user_priv: N

Event_priv: N

Trigger_priv: N

Create_tablespace_priv: N

ssl_type:

ssl_cipher:

x509_issuer:

x509_subject:

max_questions: 0

max_updates: 0

max_connections: 0

max_user_connections: 0

plugin: *3FBBDB84EA2B2A0EA599948396AD622B7FF68183

authentication_string: NULL

password_expired: N

解决方案

It appears your user table is corrupted. Likely the reboot you mentioned triggered an upgrade to MySQL and the mysql_upgrade script was not run. This should resolve the situation:

mysql_upgrade -u root -ppassword --skip-grant-tables

mysql -u root -ppassword -e "UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'mangos'; FLUSH PRIVILEGES"

Providing the --force option to mysql_upgrade will re-apply the upgrade scripts even if an upgrade has already been done. This may be needed in case of partial restoration from backup.

Also worth mentioning, the command to change a user password has changed in MySQL 5.7.6 / MariaDB 10.2.0 and forward:

ALTER USER mangos IDENTIFIED BY 'mangos';

This is now the preferred method for setting the password, although the older SET PASSWORD syntax is not officially deprecated.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值