在服务器本机可以用一个非 root 用户 tong 登陆,不过无法使用mysql表,估计是权限不够。远程使用 tong 连接数据库 提示1045 错误 。密码不对。请问有什么办法可以实现远程登录?或者查看是否被禁止也行

解决方案 »

  1.   

    grant all on *.* to tong@'%' identified by 'passwd';
    要是linux 的话,还要把my.cnf里面的bind_address这行注释掉
      

  2.   

    grant all on *.* to tong@'%identified by 'passwd';
    %:这个是赋予远程的权限.
    identified by 'passwd':设置密码.
    msyql默认的bind-address是127.0.0.1,这样的话就算你创建的用户有可以remote访问的话 也不能通过-h 来访问mysql只接受localhost. 所以要注释