Linux下MySQL允许远程连接以及授权命令

  • 针对某个库做授权
1
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
例如:
1
grant all on *.* to root@'%' identified by "123456" with grant option;
  • 收回某个库权限
1
revoke all on bool.* from myuser@'192.168.1.%';
  • 针对表做权限
1
grant insert,update,select on gy3.goods to lisi@'192.168.1.%';
  • 刷新权限
    flush privileges;
-------------本文结束感谢您的阅读-------------
0%