天天看点

Ubuntu学习三——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’

Ubuntu学习三——MySQL workbench不能连接到服务器

更改

只要将连接设置中的Hostname “127.0.0.1”改成:“::1”

Ubuntu学习三——MySQL workbench不能连接到服务器

即可成功连接到数据库。

Ubuntu学习三——MySQL workbench不能连接到服务器

官方解释

Note

The server uses the host cache only for nonlocal TCP connections. It does not use the cache for TCP connections established using a loopback interface address (for example, 127.0.0.1 or ::1), or for connections established using a Unix socket file, named pipe, or shared memory.

继续阅读