以 root 身份成功登录 MySQL 5.6 后,提示拒绝 root 访问,错误 1045 (28000)

以 root 身份成功登录 MySQL 5.6 后,提示拒绝 root 访问,错误 1045 (28000)

我最近使用 MacPorts 将 MySQL 5.5 升级到 5.6。我可以在我的笔记本电脑上正常使用我的数据库。我尝试启用对数据库的远程访问,以便我可以使用网络上其他计算机上的 DB 客户端编辑数据库,但我以 root 身份登录后,系统显示拒绝 root 访问

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 31
Server version: 5.6.19 Source distribution

Copyright (c) 2000, 2014, 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> GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

我已经尝试过发布的答案mysql 如何修复用户“root”@“localhost”的访问被拒绝但它并没有解决问题

相关内容