【发布时间】:2017-10-20 00:57:25
【问题描述】:
有成千上万的人遇到这个问题,因为我在互联网上看到它明确地确认它是 MySQL 工作台的一个恶性错误。
这是一个全新的 Kali 安装,默认安装 mysql 服务器,现在命名为 MariaDB。因此,当没有分配任何内容时,root 的密码为空,如下所示:
那么,我就这样安装mysql-workbench:
apt-get install mysql-workbench 当我尝试登录时,它说它不会让我进入。 错误信息是这样的:
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
Access denied for user 'root'@'localhost'
Please:
1 Check that mysql is running on server 127.0.0.1
2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
但是: 我可以毫无问题地从终端连接:
root@kali:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 32
Server version: 10.1.22-MariaDB- Debian 9.0
所以这证明root确实有访问权限,并且回答问题3和4的密码是正确的。
我可以验证 3306 上是否存在来自 localhost 的连接
root@kali:~# netstat -tln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp6 0 0 :::80 :::* LISTEN
root@kali:~#
回答问题 1 和 2。
这个问题自 2011 年以来一直存在,但任何地方都没有一个批准的答案。
谢谢
更新
我可以以其他用户身份登录,但不能以 root 身份登录,所以我不能做很多事情。
【问题讨论】:
标签: linux mysql-workbench