用命令行工具,登录
1、以下命令就可以授权
@‘%‘:远程访问授权 @‘localhost‘本机访问
mysql> grant all privileges on *.* to [email protected]%‘ 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/jiduoduo/p/14012396.html