MySQL in a Nutshell [46]
EXECUTE
Allows the execution of stored procedures. This is available as of version 5 of MySQL.
FILE
Allows the use of SELECT...INTO OUTFILE and LOAD DATA INFILE statements to export from and import to a file.
GRANT OPTION
Allows the use of the GRANT statement to grant privileges to users. This option is specified with the WITH clause of the GRANT statement.
INDEX
Allows the use of CREATE INDEX and DROP INDEX statements.
INSERT
Allows the use of INSERT statements.
LOCK TABLES
Allows the use of LOCK TABLES statement for tables for which the user has SELECT privileges.
PROCESS
Allows the use of SHOW FULL PROCESSLIST statements.
REFERENCES
This is not used. It’s for future releases.
RELOAD
Allows the use of FLUSH and RESET statements.
REPLICATION CLIENT
Allows the user to query master and slave servers for status information.
REPLICATION SLAVE
Required for replication slave servers. Allows binary log events to be read from the master server.
SELECT
Allows the use of the SELECT statement.
SHOW DATABASES
Permits the use of the SHOW DATABASES statement for all databases, not just the ones for which the user has privileges.
SHOW VIEW
Allows the use of the SHOW CREATE VIEW statement. This is for version 5.0.1 and above of MySQL.
SHUTDOWN
Allows the use of the shutdown option with the mysqladmin utility.
SUPER
Allows the use of CHANGE MASTER, KILL, PURGE MASTER LOGS, and SET GLOBAL statements, and the debug option with the command-line utility mysqladmin.
TRIGGER
Allows the user account to create and drop triggers: the CREATE TRIGGER and the DROP TRIGGER statements.
UPDATE
Allows the use of the UPDATE statement.
USAGE
Used to create a user without privileges, or to modify resource limits on an existing user without affecting the existing privileges.
Name
RENAME USER
Synopsis
RENAME USER 'user'[@'host'] TO 'user'[@'host'][,...]
Use this statement to change the username or the host of an existing user account. It does not change the user privileges or necessarily migrate any privileges to specific databases, events, stored routines, tables, triggers, or views. Here is an example:
RENAME USER 'michaelzabalaoui'@'localhost' TO 'zabb'@'%',
'richardstringer'@'localhost' TO 'littlerichard'@'localhost';
The first user’s name and host have been changed here, whereas the second user’s name only was changed.
Name
RESET
Synopsis
RESET [QUERY CACHE|MASTER|SLAVE]
Use this statement to reset certain server settings and log files. The RELOAD privilege is required to use this statement. The QUERY CACHE option clears the cache containing SQL query results.
Use the MASTER option to reset a master used for replication. This statement must be executed from the master itself. It will start a new binary log file, as well as delete the binary log file names from the index file and delete the contents of the binary log index file. The SLAVE option is used to reset a slave used for replication and must be executed from the slave itself. It will start a new relay log file and delete any existing ones, as well as delete its notation of its position in the master’s binary log. See Chapter 8 on replication for more information on these two options.
Name
REVOKE
Synopsis
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user[, ...]
REVOKE privilege[,...] [(column[, ...])]
ON {[{database|*}.{table|*}] | *}
FROM 'user'@'host'[, ...]
Use this statement to revoke some or all privileges that were granted to a user with the GRANT statement. The first syntax is used to revoke all privileges from a user. Multiple users may be given in a comma-separated list. A list of users and their privileges are stored in the mysql database, in the user table in particular:
REVOKE ALL PRIVILEGES
ON *.*
FROM 'paola'@localhost';
To revoke only some privileges, use the second syntax structure, giving the specific privileges to be