mysql中打开远程访问权限
我的mysql是5.7版本
//添加远程用户admin密码为password
grant all privileges on *.* to admin@localhost identified by 'password' with grant option
如果是固定ip就这么写
grant all privileges on *.* to 'admin'@'192.168.0.49' identified by '123' with grant option;
如果是需要ip范围的话,例如192.168.1.1,192.168.0.2需要允许访问
grant all privileges on *.* to 'admin'@'192.168.%.%' identified by '123' with grant option;
//推送设置到内存或重启服务器也行
mysql>FLUSH PRIVILEGES