进入mysql表中
use mysql;
mysql授权使用密码password从指定ip为192.168.1.1的主机连接到mysql服务器
grant all privileges on *.* to 'root'@'192.168.1.1' identified by 'password' with grant option;
刷新权限
flush privileges;
删除指定ip为192.168.1.1的主机连接到mysql服务器
delete from user where Host = "192.168.1.1";
授权用户root使用密码password从任意主机连接到mysql服务器
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
刷新权限
flush privileges;