REVOKE <privileges>

このステートメントは、既存のユーザーから権限を削除します。このステートメントを実行するには、 GRANT OPTION権限と取り消すすべての権限が必要です。

あらすじ

GrantStmt
GRANTPrivElemListONObjectTypePrivLevelTOUserSpecListRequireClauseOptWithGrantOptionOpt
PrivElemList
PrivElem,
PrivElem
PrivType(ColumnNameList)
PrivType
ALLPRIVILEGESALTERROUTINECREATEUSERTEMPORARYTABLESVIEWROLEROUTINETRIGGERDELETEDROPROLEPROCESSEXECUTEINDEXINSERTSELECTSUPERSHOWDATABASESVIEWUPDATEGRANTOPTIONREFERENCESREPLICATIONSLAVECLIENTUSAGERELOADFILECONFIGLOCKTABLESEVENTSHUTDOWN
ObjectType
TABLE
PrivLevel
*.*Identifier.*Identifier
UserSpecList
UserSpec,
RequireClauseOpt
REQUIRENONESSLX509RequireListElementAND
RequireListElement
ISSUERIssuerSUBJECTSubjectCIPHERCipherSANSANTOKEN_ISSUERTokenIssuer

mysql> CREATE USER 'newuser' IDENTIFIED BY 'mypassword'; Query OK, 1 row affected (0.02 sec) mysql> GRANT ALL ON test.* TO 'newuser'; Query OK, 0 rows affected (0.03 sec) mysql> SHOW GRANTS FOR 'newuser'; +-------------------------------------------------+ | Grants for newuser@% | +-------------------------------------------------+ | GRANT USAGE ON *.* TO 'newuser'@'%' | | GRANT ALL PRIVILEGES ON test.* TO 'newuser'@'%' | +-------------------------------------------------+ 2 rows in set (0.00 sec) mysql> REVOKE ALL ON test.* FROM 'newuser'; Query OK, 0 rows affected (0.03 sec) mysql> SHOW GRANTS FOR 'newuser'; +-------------------------------------+ | Grants for newuser@% | +-------------------------------------+ | GRANT USAGE ON *.* TO 'newuser'@'%' | +-------------------------------------+ 1 row in set (0.00 sec) mysql> DROP USER 'newuser'; Query OK, 0 rows affected (0.14 sec) mysql> SHOW GRANTS FOR 'newuser'; ERROR 1141 (42000): There is no such grant defined for user 'newuser' on host '%'

MySQLの互換性

こちらも参照

このページは役に立ちましたか?