1、连接上本地mysql数据库
mysql -uroot -ppwd
2、设置授权,对所有用户开放权限
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges;
3、打开本地安装的mysql配置文件my.cnf,将其中的bind-address = 127.0.0.1修改为bind-address = 0.0.0.0
4、重启mysql服务即可远程访问