1. 程式人生 > >mysql 權限管理

mysql 權限管理

height -h spa lac lin 管理 alt side one

#給用戶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;  

  1. #給用戶cacti賦予所有庫的所有權限
  2. GRANT ALL PRIVILEGES ON *.* TO ‘cacti‘@‘%‘ IDENTIFIED BY ‘cacti‘ WITH GRANT OPTION;
  3. #重新載入賦權表
  4. FLUSH PRIVILEGES;
  5. #收回權限(不包含賦權權限)
  6. REVOKE ALL PRIVILEGES ON *.* FROM cacti;
  7. REVOKE ALL PRIVILEGES ON cacti.* FROM cacti;
  8. #收回賦權權限
  9. REVOKE GRANT OPTION ON *.* FROM cacti;
  10. #重新載入賦權表
  11. FLUSH PRIVILEGES;

mysql 權限管理