有成千上万的人遇到这个问题,正如我在互联网上查看的那样,这证实了它确实是 MySQL Workbench 的一个恶性错误。
这是全新的 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 上是否存在来自本地主机的连接
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 身份登录,因此我无法执行很多操作。
最佳答案
我使用 kali 图像做了一些测试。它使用 mariadb ,但是相同的软件。我发现新版本的 MySQL Server 使用 unix_socket 插件进行身份验证。我所做的就是删除用户 root 的身份验证并使其连接可用。我已经创建了一个具有所有权限的备用用户作为备份和连接用户:如果出现错误,您将无法以任何方式与 root 用户连接!
这是显示所有过程的视频链接。这对我有用!
祝你好运
米盖尔
关于linux - MySQL Workbench 不会让 root 连接基于 Linux 的 debian,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44077772/