Navicat远程连接mysql服务器,出现错误1045

目录

用客户端navicat 远程连接mysql时,拒绝访问,报错:“1045-Acess denied for user root @“服务器地址”(useing password:yes)”

 


  1. 解疑:此处错误,说明mysql服务起未授权,登录,用户名正确,所以需要在mysql服务器上,给远程登录用户添加访问权限。
  2. 解决方法1:登录mysql服务器,添加权限,输入如下命令:
  3. grant all on *.* to 用户名@"服务器名" identified by "密码";
    
    flush priviledes;
  4. 授权法  将host字段值改为% ,就表示在任何客户端机机器上,都能以root用户登录到mysql服务器上,命令如下:
update user set host = '%' where user = 'root';
// 将权限改为all privileges
use mysql;
// database changed
grant all privileges on *.* to root@'%' identified by 'root';
select host,user,password from user; //查询host user,密码 

 

你可能感兴趣的:(个人)