编辑:我发现了问题:我的密码包含字符\
。键入没有此角色的密码。这显然是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):拒绝访问用户&root;' @' localhost' (使用密码:是)
我尝试使用其他参数运行此命令,但没有-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安装。鉴于很少有人在重新安装后似乎遇到了这个问题,我想我错过了一些重要的东西,但我无法弄清楚是什么。
如果你有任何提示可以解释为什么我无法登录,请告诉我。