mysql添加远程链接权限

查看登陆用户

mysql> select host,user,password from user;

  • 想用本地IP登陆,那么能够将以上的Host值改成本身的Ip便可。
  • 这里有多个root,对应着不一样场景。(后期研究为何mysql表有多个root)

给远程链接受权

mysql> use mysql;
Database changed

mysql> grant all privileges  on *.* to root@'%' identified by "root";
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> select host,user,password from user;

最后远程能用root\root登陆了,可是本地只能用空密码登陆了,权限也不同。留个TO-DO。html


参考

http://www.javashuo.com/article/p-urvjqbyi-kq.htmlmysql

相关文章
相关标签/搜索