Oracle 5.0 Reference Manual page 1174

Table of Contents

Advertisement

Global Privileges
Global privileges are administrative or apply to all databases on a given server. To assign global
privileges, use
GRANT ALL ON *.* TO 'someuser'@'somehost';
GRANT SELECT, INSERT ON *.* TO 'someuser'@'somehost';
Before MySQL 5.0.23, privileges also are assigned at the global level if you use
have not selected a default database. As of 5.0.23,
error if there is none.
The
CREATE USER
REPLICATION SLAVE
are administrative and can only be granted globally.
Other privileges can be granted globally or at more specific levels.
MySQL stores global privileges in the
Database Privileges
Database privileges apply to all objects in a given database. To assign database-level privileges, use
ON db_name.*
GRANT ALL ON mydb.* TO 'someuser'@'somehost';
GRANT SELECT, INSERT ON mydb.* TO 'someuser'@'somehost';
If you use
ON *
assigned at the database level for the default database. An error occurs if there is no default database.
The CREATE, DROP,
database level. Table or routine privileges also can be specified at the database level, in which case
they apply to all tables or routines in the database.
MySQL stores database privileges in the
Table Privileges
Table privileges apply to all columns in a given table. To assign table-level privileges, use
db_name.tbl_name
GRANT ALL ON mydb.mytbl TO 'someuser'@'somehost';
GRANT SELECT, INSERT ON mydb.mytbl TO 'someuser'@'somehost';
If you specify
default database. An error occurs if there is no default database.
The permissible
[576],
CREATE
[578],
SELECT
MySQL stores table privileges in the
Column Privileges
Column privileges apply to single columns in a given table. Each privilege to be granted at the column
level must be followed by the column or columns, enclosed within parentheses.
GRANT SELECT (col1), INSERT (col1,col2) ON mydb.mytbl TO 'someuser'@'somehost';
The permissible
[577],
INSERT
Account Management Statements
syntax:
ON *.*
[576],
[577],
FILE
[577],
SHOW DATABASES
syntax:
syntax (rather than
ON
GRANT OPTION
syntax:
rather than db_name.tbl_name, the statement applies to
tbl_name
values at the table level are
priv_type
[577],
[577],
DELETE
DROP
[578], and
SHOW VIEW
values for a column (that is, when you use a
priv_type
[578], and
SELECT
UPDATE
requires a default database and produces an
ON *
[577],
PROCESS
RELOAD
[578],
SHUTDOWN
table.
mysql.user
*.*) and you have selected a default database, privileges are
[577], and
LOCK TABLES
table.
mysql.db
ALTER
GRANT OPTION
[578].
UPDATE
mysql.tables_priv
[578].
1154
ON *
[577],
REPLICATION CLIENT
[578], and
SUPER
[577]
privileges can be specified at the
[576],
CREATE VIEW
[577],
[577],
INDEX
INSERT
table.
column_list
syntax and you
[577],
[578]
privileges
ON
in the
tbl_name
[577],
[577],
clause) are

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents