无法从 Linux 上的 MySQL Workbench 连接到 MySQL

Unable to connect to MySQL from MySQL Workbench on Linux

提问人:devguy 提问时间:11/29/2018 最后编辑:FloTdevguy 更新时间:11/29/2018 访问量:4105

问:

更新

问题似乎与读取密码有关。我尝试了一些东西,但这不是一种完全安全的方法,也许有人可以解释如何让密码起作用。

我打开了位于下方的密码,并将我的密码添加到最初为空的配置中。connections.xml$USER/.mysql/workbench

    <value type="string" key="password">MYPASSWORD</value>

现在工作台连接良好,但我不喜欢这个解决方案。我不知道为什么工作台不要求我输入密码。还尝试将密码从 GUI 保存到“存储在钥匙串中...”选项不起作用,并导致以下错误:

enter image description here

原始问题

在 ubuntu 18.04 上更新到 mysql 8.0.13 后,我能够从终端连接到 mysql,但工作台无法连接。

$ mysql -u root -p -h 0.0.0.0 -P 3306
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

当我尝试以root身份连接到mysql工作台时,出现以下错误对话框。

enter image description here

以下是我对 root 用户的连接设置:

enter image description here

我按照主网站的说明使用 APT 存储库安装了 8.0.13 版:https://dev.mysql.com/downloads/repo/apt/

这指向此处的步骤:https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/

ubuntu mysql-workbench

评论

0赞 John Joe 11/29/2018
为什么不直接将您的主机名命名为 localhost ?
0赞 Mike Lischke 11/29/2018
根据屏幕截图,我假设您正在使用 KDE。在这种情况下,请尝试安装 gnome-keyring:,然后再次尝试从 MySQL Workbench 连接到 MySQL 服务器。sudo apt install gnome-keyring
0赞 Altmish-E-Azam 11/29/2018
尝试使用主机名而不是 IP 地址进行连接,因为 IP 表示它正在侦听全局主机。0.0.0.0
0赞 Wodin 11/29/2018
0.0.0.0不是问题。问题是MySQL Workbench找不到获取/存储密码的位置。我同意@MikeLischke安装 gnome-keyring 值得一试。我敢肯定 KDE 也有类似的东西,例如 kwallet。

答: 暂无答案