- zhangsan用户可以从任何ip连接
GRANT SELECT,INSERT,UPDATE,SELECT ON test.* to zhangsan@'%' IDENTIFIED BY '123';
- zhangsan用户可以从本地执行所有权限
GRANT ALL PRIVILEGES ON *.* to zhangsan@'localhost' IDENTIFIED BY '123';
- 权限回收
REVOKE SELECT ON *.* FROM zhangsan@localhost
- 刷新权限
FLUSH PRIVILEGES;