无法使用mysql中创建的用户登录 [英] Cannot log in with created user in mysql

查看:138
本文介绍了无法使用mysql中创建的用户登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用此命令

GRANT ALL PRIVILEGES ON *.* to 'brian'@'%' identified by 'password';

我尝试登录:

 mysql -u brian -ppassword

错误是:

ERROR 1045 (28000): Access denied for user 'brian'@'localhost' (using password: YES)

我以root用户身份执行此操作,并且确实尝试清除特权.

I am doing this as root and I did try to flush privileges.

我尝试了无数用户,但是它似乎不起作用.我可以创建一个没有密码的用户,并且登录有效.命令行和通过phpmyadmin

I tried this with countless users but it does not seem to work. I can create a user with no password and login works. Command line and from phpmyadmin

还要检查用户是否在mysql.user中.

Also check to see if the user was in mysql.user which it is.

为布赖恩表演提供表演赠款:

Show grants for brian shows:

| GRANT ALL PRIVILEGES ON *.* TO 'brian'@'%' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' |

推荐答案

您可能会遇到这种永久性的MySQL问题,其中用户表中的默认用户之一是'' @ localhost,最终在以后拒绝所有localhost用户桌子.我要做的是mysqldump mysql数据库,并在User表中查找该条目;如果找到,请删除它并刷新特权.

You probably have this perpetual MySQL problem where one of the default users in the user table is '' @ localhost, which winds up denying all localhost users later in the table. What I would do is mysqldump the mysql database and look for this entry in the User table; if found, delete it and flush privileges.

有关更多详细信息,请参见 https://dev.mysql. com/doc/refman/5.5/en/connection-access.html .

For more details see https://dev.mysql.com/doc/refman/5.5/en/connection-access.html.

一个常见的误解是认为,对于给定的用户名,当服务器尝试查找连接的匹配项时,首先使用显式命名该用户的所有行.这不是真的.前面的示例对此进行了说明,其中jeffrey与h1.example.net的连接首先不与包含"jeffrey"作为用户"列值的行匹配,而是与没有用户名的行匹配. 结果是,即使jeffrey在连接时指定了用户名,他也被认证为匿名用户.

这篇关于无法使用mysql中创建的用户登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆