Privileges Provided by MySQL
578
• The
SELECT
[578]
privilege enables you to select rows from tables in a database.
SELECT
statements require the
SELECT
[578]
privilege only if they actually retrieve rows from a table. Some
SELECT
statements do not access tables and can be executed without permission for any database.
For example, you can use
SELECT
as a simple calculator to evaluate expressions that make no
reference to tables:
SELECT 1+1;
SELECT PI()*2;
The
SELECT
[578]
privilege is also needed for other statements that read column values.
For example,
SELECT
[578]
is needed for columns referenced on the right hand side of
col_name
=
expr
assignment in
UPDATE
statements or for columns named in the
WHERE
clause of
DELETE
or
UPDATE
statements.
• The
SHOW DATABASES
[578]
privilege enables the account to see database names by issuing the
SHOW DATABASE
statement. Accounts that do not have this privilege see only databases for which
they have some privileges, and cannot use the statement at all if the server was started with the
--
skip-show-database
[421]
option. Note that any global privilege is a privilege for the database.
• The
SHOW VIEW
[578]
privilege enables use of
SHOW CREATE VIEW
. This privilege was added in
MySQL 5.0.1.
• The
SHUTDOWN
[578]
privilege enables use of the
mysqladmin shutdown
command. There is no
corresponding SQL statement.
• The
SUPER
[578]
privilege enables an account to use
CHANGE MASTER TO
,
KILL
or
mysqladmin
kill
to kill threads belonging to other accounts (you can always kill your own threads),
PURGE
BINARY LOGS
, configuration changes using
SET GLOBAL
to modify global system variables, the
mysqladmin debug
command, enabling or disabling logging, performing updates even if the
read_only
[488]
system variable is enabled, starting and stopping replication on slave servers,
specification of any account in the
DEFINER
attribute of stored programs and views, and enables
you to connect (once) even if the connection limit controlled by the
max_connections
[467]
system
variable is reached.
To create or alter stored routines if binary logging is enabled, you may also need the
SUPER
[578]
privilege, as described in
Section 18.6, “Binary Logging of Stored Programs”
.
• The
UPDATE
[578]
privilege enables rows to be updated in tables in a database.
• The
USAGE
[578]
privilege specifier stands for “no privileges.” It is used at the global level with
GRANT
to modify account attributes such as resource limits or SSL characteristics without affecting
existing account privileges.
It is a good idea to grant to an account only those privileges that it needs. You should exercise
particular caution in granting the
FILE
[577]
and administrative privileges:
• The
FILE
[577]
privilege can be abused to read into a database table any files that the MySQL
server can read on the server host. This includes all world-readable files and files in the server's data
directory. The table can then be accessed using
SELECT
to transfer its contents to the client host.
• The
GRANT OPTION
[577]
privilege enables users to give their privileges to other users. Two users
that have different privileges and with the
GRANT OPTION
[577]
privilege are able to combine
privileges.
• The
ALTER
[576]
privilege may be used to subvert the privilege system by renaming tables.
• The
SHUTDOWN
[578]
privilege can be abused to deny service to other users entirely by terminating
the server.
• The
PROCESS
[577]
privilege can be used to view the plain text of currently executing statements,
including statements that set or change passwords.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...