Privileges Provided by MySQL
575
If your privileges are changed (either by yourself or someone else) while you are connected, those
changes do not necessarily take effect immediately for the next statement that you issue. For details
about the conditions under which the server reloads the grant tables, see
Section 6.2.6, “When
Privilege Changes Take Effect”
.
For general security-related advice, see
Section 6.1, “General Security Issues”
. For help in diagnosing
privilege-related problems, see
Section 6.2.7, “Causes of Access-Denied Errors”
.
6.2.1. Privileges Provided by MySQL
MySQL provides privileges that apply in different contexts and at different levels of operation:
• Administrative privileges enable users to manage operation of the MySQL server. These privileges
are global because they are not specific to a particular database.
• Database privileges apply to a database and to all objects within it. These privileges can be granted
for specific databases, or globally so that they apply to all databases.
• Privileges for database objects such as tables, indexes, views, and stored routines can be granted
for specific objects within a database, for all objects of a given type within a database (for example,
all tables in a database), or globally for all objects of a given type in all databases).
Information about account privileges is stored in the
user
,
db
,
host
,
tables_priv
,
columns_priv
,
and
procs_priv
tables in the
mysql
database (see
Section 6.2.2, “Privilege System Grant Tables”
).
The MySQL server reads the contents of these tables into memory when it starts and reloads them
under the circumstances indicated in
Section 6.2.6, “When Privilege Changes Take Effect”
. Access-
control decisions are based on the in-memory copies of the grant tables.
Some releases of MySQL introduce changes to the structure of the grant tables to add new access
privileges or features. Whenever you update to a new version of MySQL, you should update your grant
tables to make sure that they have the current structure so that you can take advantage of any new
capabilities. See
Section 4.4.9, “
mysql_upgrade
— Check Tables for MySQL Upgrade”
.
The following table shows the privilege names used at the SQL level in the
GRANT
and
REVOKE
statements, along with the column name associated with each privilege in the grant tables and the
context in which the privilege applies.
Table 6.2. Permissible Privileges for
GRANT
and
REVOKE
Privilege
Column
Context
CREATE
[576]
Create_priv
databases, tables, or indexes
DROP
[577]
Drop_priv
databases, tables, or views
GRANT OPTION
[577]
Grant_priv
databases, tables, or stored routines
LOCK TABLES
[577]
Lock_tables_priv
databases
REFERENCES
[577]
References_priv
databases or tables
ALTER
[576]
Alter_priv
tables
DELETE
[577]
Delete_priv
tables
INDEX
[577]
Index_priv
tables
INSERT
[577]
Insert_priv
tables or columns
SELECT
[578]
Select_priv
tables or columns
UPDATE
[578]
Update_priv
tables or columns
CREATE TEMPORARY
TABLES
[576]
Create_tmp_table_priv
tables
CREATE VIEW
[577]
Create_view_priv
views
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...