mysql赋权与收回权限(grant&revoke)

为一个用户赋权

收回权限

 

#给用户cacti赋予所有库的所有权限
GRANT ALL PRIVILEGES ON *.* TO 'cacti'@'%' IDENTIFIED BY 'cacti' WITH GRANT OPTION;
#重新载入赋权表
FLUSH PRIVILEGES;

#收回权限(不包含赋权权限)
REVOKE ALL PRIVILEGES ON *.* FROM cacti;
REVOKE ALL PRIVILEGES ON cacti.* FROM cacti;
#收回赋权权限
REVOKE GRANT OPTION ON *.* FROM cacti;
#重新载入赋权表
FLUSH PRIVILEGES;


 

 

 

你可能感兴趣的:(数据库(mysql),mysql)