错误 1045 (28000):对于 Amazon Linux 2 上的 mysql Ver 15.1,用户“root”@“localhost”使用密码:YES的访问被拒绝

问题描述

当我尝试通过“-p”提示登录MysqL 时会发生错误,但如果我在同一行(没有提示)上输入密码则不会发生错误 - 这是一个不好的做法。

我在 Amazon Linux 2 上安装了 MysqL 15.1 版:

这会引发错误提示):

$MysqL -u root -p

Enter Password:<Password>

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

这有效(没有提示):

$MysqL -u root -p<Password>

Welcome to the MariaDB monitor.  Commands end with ; or \g.

记住“-p”和“密码”之间“没有空格”

知道为什么会这样吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)