受权能够mysql主机ip访问mysql:mysql
进入bin目录,打开cmd;
mysql -u root -p;
use mysql;
update user set host='%' where user='root';
select user,host from user;sql
新增用户并受权访问指定数据库:
grant all privileges on *.* to '用户名'@'%' identified by '密码' with grant option;
flush privileges;数据库
指定数据库,将*.*改成“数据库名.*”,
指定客户端ip,将%改成客户端ip
all privileges 表明全部权限;ide
删除用户及受权
drop user 用户名@'%'ip