gpt4 book ai didi

MySQL 5.6 : Access denied for user 'root' @ 'localhost' when password contains backslash

转载 作者:太空宇宙 更新时间:2023-11-04 10:58:55 25 4
gpt4 key购买 nike

编辑:我发现了问题所在:我的密码包含字符 \。输入没有此字符的密码有效。这显然是 due to a character encoding problem .


我最近在我的机器上安装了 MySQL Server 5.6,运行 ubuntu 14.04。

我已经关注了 manual to install mysql from the APT repository .在安装过程中,我被要求输入 root 用户的密码。我设置了一个。

现在,关注 some post-installation tutorial例如,尝试运行 SQL 查询时,我无法访问 mysql shell。

我尝试运行命令:

mysql -u root -p

然后输入我的密码,得到消息:

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

我尝试使用其他参数运行此命令,没有 -p-h localhost-h 127.0.0.1,有相似的结果。

我尝试了一些在这里和那里找到的建议,比如 a manual to reset permission with an init file when starting the service sudo service start --init-file=/path/to/file ,或使用选项 --skip-grant-tables 启动服务的一些建议。这些命令成功启动了服务,但我仍然无法登录。

启动服务后,看到如下error.log

InnoDB: 5.6.22 started;
Server hostname (bind-address): '127.0.0.1'; port: 3306
'127.0.0.1' resolves to '127.0.0.1';
Server socket created on IP: '127.0.0.1'.
Event Scheduler: Loaded 0 events
/usr/sbin/mysqld: ready for connections.

我用尽了所有选项来尝试访问我安装的 MySQL。鉴于似乎很少有人在全新安装后遇到这个问题,我想我错过了一些重要的东西,但我不知道是什么。

如果您对我无法登录的原因有任何提示,请告诉我。

最佳答案

我发现了问题:我的密码包含字符 \。输入没有此字符的密码有效。这显然是 due to a character encoding problem . ——文斯

关于MySQL 5.6 : Access denied for user 'root' @ 'localhost' when password contains backslash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27710531/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com