开启MySQL远程访问权限 允许远程连接

mysql> use mysql;
Database changed
mysql> grant all privileges  on *.* to root@'%' identified by "密码";
--%是表示所有的远程机器,如果指定单台此处写成ip
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;

--查看用户情况
mysql> select host,user,password from user;

 

你可能感兴趣的:(mysql)