MASTER,KILL,PURGE MASTER LOGS, andSET GLOBALSQL statements. Allowsmysqladmin debugcommand. Allows one extra connection to be made if maximum connections are reached.
例子: SET PASSWORD FOR 'pig'@'%' =PASSWORD("123456");
四.撤销用户权限
命令: REVOKE privilege ON databasename.tablename FROM'username'@'host';
说明: privilege, databasename, tablename -同授权部分.
例子: REVOKE SELECT ON *.* FROM 'pig'@'%';
注 意:假如你在给用户'pig'@'%'授权的时候是这样的(或类似的):GRANT SELECT ON test.user TO
'pig'@'%',则在使用REVOKE SELECT ON *.* FROM 'pig'@'%';命令并不能撤销该用户对test数据库中user表的SELECT操作.相反,如果授权使用的是GRANT SELECT ON *.* TO 'pig'@'%';则REVOKE
SELECT ON test.user FROM 'pig'@'%';命令也不能撤销该用户对test数据库中user表的Select权限.
具体信息可以用命令SHOW GRANTS FOR 'pig'@'%';查看.
五.删除用户
命令: DROP USER 'username'@'host';
附表:在MySQL中的操作权限
ALTER
Allows use ofALTER
TABLE.
ALTER ROUTINE
Alters or drops stored routines.
CREATE
Allows use ofCREATE
TABLE.
CREATE ROUTINE
Creates stored routines.
CREATE TEMPORARY TABLE
Allows use ofCREATE
TEMPORARY TABLE.
CREATE USER
Allows use ofCREATE
USER,DROP USER,RENAME USER, andREVOKE ALL PRIVILEGES.
CREATE VIEW
Allows use ofCREATE
VIEW.
DELETE
Allows use ofDELETE.
DROP
Allows use ofDROP
TABLE.
EXECUTE
Allows the user to run stored routines.
FILE
Allows use ofSELECT...INTO OUTFILEandLOAD DATA INFILE.
INDEX
Allows use ofCREATE
INDEXandDROP INDEX.
INSERT
Allows use ofINSERT.
LOCK TABLES
Allows use ofLOCK
TABLESon tables for which the user also hasSELECTprivileges.
PROCESS
Allows use ofSHOW
FULL PROCESSLIST.
RELOAD
Allows use ofFLUSH.
REPLICATION
Allows the user to ask where slave or master
CLIENT
servers are.
REPLICATION SLAVE
Needed for replication slaves.
SELECT
Allows use ofSELECT.
SHOW DATABASES
Allows use ofSHOW
DATABASES.
SHOW VIEW
Allows use ofSHOW
CREATE VIEW.
SHUTDOWN
Allows use ofmysqladmin
shutdown.
SUPER
Allows use ofCHANGE
MASTER,KILL,PURGE MASTER LOGS, andSET GLOBALSQL statements. Allowsmysqladmin debugcommand. Allows one extra connection to be made if maximum connections are reached.
UPDATE
Allows use ofUPDATE.
USAGE
Allows connection without any specific privileges.
网友评论