mysql workbench无法连接到数据库,但连接测试正常

标签 mysql mysql-workbench

我有一个 mysql 服务器,用户为“root”,没有密码。
当我在终端中执行 mysql -u root -p 时,我可以连接到我的服务器。
当我使用mysql workbench时,如果我测试这个连接,它是成功的。
但是当我尝试使用 mysql workbench 连接到服务器时出现此错误:

Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306: Could not open database

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

有人知道这里出了什么问题吗?

[更新]
我仍然遇到这个问题。
使用 mysql workbench:测试连接正常,但我无法连接到 mysql 服务器。
如果这有帮助,这里是 mysql 服务器状态:
mysql Ver 14.14 Distrib 5.6.28,用于使用 EditLine 包装器的 debian-linux-gnu (x86_64)

Connection id:      7
Current database:   
Current user:       root@localhost
SSL:            Not in use
Current pager:      stdout
Using outfile:      ''
Using delimiter:    ;
Server version:     5.6.28-0ubuntu0.15.10.1 (Ubuntu)
Protocol version:   10
Connection:     localhost via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
TCP port:       3306
Uptime:         50 sec

Threads: 3  Questions: 69  Slow queries: 0  Opens: 67  Flush tables: 1  Open tables: 60  Queries per second avg: 1.380

感谢您的帮助。

最佳答案

我自己也遇到了这个完全相同的问题。

我可以通过“以管理员身份”运行 Mysql Workbench 来克服它。 (关闭任何正在运行的实例。从开始菜单中右键单击它,然后选择“以管理员身份运行”。)

如果我不以提升的权限运行它,它就不会连接。所以这一定是 Workbench 中的某种缺陷或错误。

关于mysql workbench无法连接到数据库,但连接测试正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35913946/

相关文章:

MySQL:使用附加哈希字段的唯一文本字段

mysql - 从 MYSQL 子查询中删除

mysql - ERROR 1005 MySQL Workbench 正向工程

mysql - 如何将 Apache 指向具有 MySQL 的单独 EC2 实例?

mysql - NodeJS 无法连接到 Docker 容器内的 MYSQL 最新版本

mysql - 将本地 mysql 数据库复制到 Amazon RDS

php - Codeigniter 从结果行中获取 2 列()

mysql - 在 MAC OS X 10.10.2 上将 Excel 工作表导入 MySQL

mysql - 购买了表 Y 中所有产品的表 X 中那些客户 ID 的列表?

MYSQL 工作台 - 数据库文件的位置 - win 8