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不能连接到服务器_第1张图片

更改

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

Ubuntu学习三——MySQL workbench不能连接到服务器_第2张图片

即可成功连接到数据库。

Ubuntu学习三——MySQL workbench不能连接到服务器_第3张图片

官方解释

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.

你可能感兴趣的:(Lunix学习,数据库学习,操作系统学习)