mysql远程访问授权

mysql远程访问授权

 

 用命令行工具,登录

1、以下命令就可以授权

@‘%‘:远程访问授权 @‘localhost‘本机访问

mysql> grant all privileges on *.* to ‘用户名‘@‘%‘ identified by ‘密码‘
with grant option;

mysql> flush privileges;

 

mysql> select host, user ,authentication_string from user;
+-----------+---------------+-------------------------------------------+
| host | user | authentication_string |
+-----------+---------------+-------------------------------------------+
| localhost | root | *F639C88D14D6F97EE915C916066C13C7E6127BEA |

 

mysql5.7以上password改成了authentication_string。

参考:

https://www.cnblogs.com/cnsdhzzl/p/11479808.html 

https://www.cnblogs.com/youcong/p/10887068.html

mysql远程访问授权

上一篇:数据库设计心得——还不知道叫什么对 (作者:李俊 PM:杨佳)


下一篇:Docker安装Mysql5.7