mysql远程登录

对用户授权方法。
在目录/etc/mysql下找到my.cnf,用vim编辑,找到my.cnf里面的   

bind-address           = 127.0.0.1

将其注释。

然后用root登陆Mysql数据库。

然后在mysql>这里输入:grant all on *.* to username@'%' identified by 'password;
注意:username是用户名,password是要自己填写的一个名字,例如:
grant all on *.* to zl@'%' identified by '123456';

最后刷新一下。执行:flush privileges;

6.配置完文件后重启服务
最后就可以在远程用刚才创建的用户和密码登陆mysql。

原文地址:https://www.cnblogs.com/weihu/p/9069576.html