Navicat连接mysql数据库报错:1045 - Access denied for user ‘root’@‘localhost’ (using password: YES)。
这是数据库权限的问题,workbench等也会同样报错
问题所在:未给root用户分配所有权限,本地客户端无权限登录root用户。
以root用户登录mysql,运行show grants for ‘user’@‘IP’;
show grants for ‘root’@‘192.168.170.136’;
ERROR 1141 (42000): There is no such grant defined for user ‘root’ on host ‘192.168.170.136’
show grants for ‘root’@‘localhost’;
±---------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost |
±---------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON . TO ‘root’@‘localhost’ IDENTIFIED BY PASSWORD ‘*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B’ WITH GRANT OPTION |
±--------------------------