别人需要连接自己数据库的时候需要对其开发远程连接。

1、进入MySQL

MySQL允许远程控制

2、使用mysql库执行use mysql;

MySQL允许远程控制

3、查询表中 执行:select user,password,host from user;

MySQL允许远程控制

4、执行:grant all privileges on *.* to root@"xxx.xxx.xxx.xxx" identified by "密码";

xxx.xxx.xxx.xxx :表示为允许访问的主机ip;密码:表示本数据库的连接密码

5、执行之后再次查询:select user,password,host from user;

 

相关文章: