mysql5远程连接服务器时,出现类似:?
ERROR 1044: Access denied for user: '@127.0.0.1' to database 'mysql'?
的错误。?
说明你没有将权限下放到远端连接帐户上,由于mysql的安全性在不断的提高,权限设置默认是拒绝的,你必须自己开放权限。?
在服务器上用mysql -h 192.168.0.1 -u root -p mysql命令登录mysql数据库?
然后用grant命令下放权限。?
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'root-password' WITH GRANT OPTION;?
GRANT ALL PRIVILEGES ON *.* TO root@127.0.0.1 IDENTIFIED BY 'root-password' WITH GRANT OPTION;?
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'root-password' WITH GRANT OPTION;?
例如:?
GRANT?? ALL?? PRIVILEGES?? ON?? *.*?? TO?? root@'%'?? identified?? by?? '123456'???
注意:自己根据情况修改以上命令中的 “用户”“ip地址”“密码”。