
* sync_relay_log, and
* sync_relay_log_info.

Added in MariaDB 10.5.2.

SET USER
--------

Enables setting the DEFINER when creating triggers, views, stored functions
and stored procedures. Added in MariaDB 10.5.2.

SHOW DATABASES
--------------

List all databases using the SHOW DATABASES statement. Without the SHOW
DATABASES privilege, you can still issue the SHOW DATABASES statement, but it
will only list databases containing tables on which you have privileges.

SHUTDOWN
--------

Shut down the server using SHUTDOWN or the mariadb-admin shutdown command.

SUPER
-----

Execute superuser statements: CHANGE MASTER TO, KILL (users who do not have
this privilege can only KILL their own threads), PURGE LOGS, SET global system
variables, or the mariadb-admin debug command. Also, this permission allows
the user to write data even if the read_only startup option is set, enable or
disable logging, enable or disable replication on replica, specify a DEFINER
for statements that support that clause, connect once reaching the
MAX_CONNECTIONS. If a statement has been specified for the init-connect mysqld
option, that command will not be executed when a user with SUPER privileges
connects to the server.

The SUPER privilege has been split into multiple smaller privileges from
MariaDB 10.5.2 to allow for more fine-grained privileges (MDEV-21743). The
privileges are:

* SET USER
* FEDERATED ADMIN
* CONNECTION ADMIN
* REPLICATION SLAVE ADMIN
* BINLOG ADMIN
* BINLOG REPLAY
* REPLICA MONITOR
* BINLOG MONITOR
* REPLICATION MASTER ADMIN
* READ_ONLY ADMIN

However, the smaller privileges are still a part of the SUPER grant in MariaDB
10.5.2. From MariaDB 11.0.1 onwards, these grants are no longer a part of
SUPER and need to be granted separately (MDEV-29668).

From MariaDB 10.11.0, the READ_ONLY ADMIN privilege has been removed from
SUPER. The benefit of this is that one can remove the READ_ONLY ADMIN
privilege from all users and ensure that no one can make any changes on any
non-temporary tables. This is useful on replicas when one wants to ensure that
the replica is kept identical to the primary (MDEV-29596).

Database Privileges
-------------------

The following table lists the privileges that can be granted at the database
level. You can also grant all table and function privileges at the database
level. Table and function privileges on a database apply to all tables or
functions in that database, including those created later.

To set a privilege for a database, specify the database using db_name.* for
priv_level, or just use * to specify the default database.

+----------------------------------+-----------------------------------------+
| Privilege                        | Description                             |
+----------------------------------+-----------------------------------------+
| CREATE                           | Create a database using the CREATE      |
|                                  | DATABASE statement, when the privilege  |
|                                  | is granted for a database. You can      |
|                                  | grant the CREATE privilege on           |
|                                  | databases that do not yet exist. This   |
|                                  | also grants the CREATE privilege on     |
|                                  | all tables in the database.             |
+----------------------------------+-----------------------------------------+
| CREATE ROUTINE                   | Create Stored Programs using the        |
|                                  | CREATE PROCEDURE and CREATE FUNCTION    |
|                                  | statements.                             |
+----------------------------------+-----------------------------------------+
| CREATE TEMPORARY TABLES          | Create temporary tables with the        |
|                                  | CREATE TEMPORARY TABLE statement. This  |
|                                  | privilege enable writing and dropping   |
|                                  | those temporary tables                  |
+----------------------------------+-----------------------------------------+
| DROP                             | Drop a database using the DROP          |
|                                  | DATABASE statement, when the privilege  |
|                                  | is granted for a database. This also    |
|                                  | grants the DROP privilege on all        |
|                                  | tables in the database.                 |
+----------------------------------+-----------------------------------------+
| EVENT                            | Create, drop and alter EVENTs.          |
+----------------------------------+-----------------------------------------+
| GRANT OPTION                     | Grant database privileges. You can      |
|                                  | only grant privileges that you have.    |
+----------------------------------+-----------------------------------------+
| LOCK TABLES                      | Acquire explicit locks using the LOCK   |
|                                  | TABLES statement; you also need to      |
|                                  | have the SELECT privilege on a table,   |
|                                  | in order to lock it.                    |
+----------------------------------+-----------------------------------------+
| SHOW CREATE ROUTINE              | Permit viewing the SHOW CREATE          |
|                                  | definition statement of a routine, for  |
|                                  | example SHOW CREATE FUNCTION, even if   |
|                                  | not the routine owner. From MariaDB     |
|                                  | 11.3.0.                                 |
+----------------------------------+-----------------------------------------+

Table Privileges
----------------

+----------------------------------+-----------------------------------------+
| Privilege                        | Description                             |
+----------------------------------+-----------------------------------------+
| ALTER                            | Change the structure of an existing     |
|                                  | table using the ALTER TABLE statement.  |
+----------------------------------+-----------------------------------------+
| CREATE                           | Create a table using the CREATE TABLE   |
|                                  | statement.  You can grant the CREATE    |
|                                  | privilege on tables that do not yet     |
|                                  | exist.                                  |
+----------------------------------+-----------------------------------------+
| CREATE VIEW                      | Create a view using the CREATE_VIEW     |
|                                  | statement.                              |
+----------------------------------+-----------------------------------------+
| DELETE                           | Remove rows from a table using the      |
|                                  | DELETE statement.                       |
+----------------------------------+-----------------------------------------+
| DELETE HISTORY                   | Remove historical rows from a table     |
|                                  | using the DELETE HISTORY statement.     |
|                                  | Displays as DELETE VERSIONING ROWS      |
|                                  | when running SHOW GRANTS until MariaDB  |
|                                  | 10.3.15 and until MariaDB 10.4.5        |
|                                  | (MDEV-17655), or when running SHOW      |
|                                  | PRIVILEGES until MariaDB 10.5.2,        |
|                                  | MariaDB 10.4.13 and MariaDB 10.3.23     |
|                                  | (MDEV-20382). From MariaDB 10.3.4.      |
|                                  | From MariaDB 10.3.5, if a user has the  |
|                                  | SUPER privilege but not this            |
|                                  | privilege, running mariadb-upgrade      |
|                                  | will grant this privilege as well.      |
+----------------------------------+-----------------------------------------+
| DROP                             | Drop a table using the DROP TABLE       |
|                                  | statement or a view using the DROP      |
|                                  | VIEW statement. Also required to        |
|                                  | execute the TRUNCATE TABLE statement.   |
+----------------------------------+-----------------------------------------+
| GRANT OPTION                     | Grant table privileges. You can only    |
|                                  | grant privileges that you have.         |
+----------------------------------+-----------------------------------------+
| INDEX                            | Create an index on a table using the    |
|                                  | CREATE INDEX statement. Without the     |
|                                  | INDEX privilege, you can still create   |
|                                  | indexes when creating a table using     |
|                                  | the CREATE TABLE statement if the you   |
|                                  | have the CREATE privilege, and you can  |
|                                  | create indexes using the ALTER TABLE    |
|                                  | statement if you have the ALTER         |
|                                  | privilege.                              |
+----------------------------------+-----------------------------------------+
| INSERT                           | Add rows to a table using the INSERT    |
|                                  | statement.  The INSERT privilege can    |
|                                  | also be set on individual columns; see  |
|                                  | Column Privileges below for details.    |
+----------------------------------+-----------------------------------------+
| REFERENCES                       | Unused.                                 |
+----------------------------------+-----------------------------------------+
| SELECT                           | Read data from a table using the        |
|                                  | SELECT statement. The SELECT privilege  |
|                                  | can also be set on individual columns;  |
|                                  | see Column Privileges below for         |
|                                  | details.                                |
+----------------------------------+-----------------------------------------+
| SHOW VIEW                        | Show the CREATE VIEW statement to       |
|                                  | create a view using the SHOW CREATE     |
|                                  | VIEW statement.                         |
+----------------------------------+-----------------------------------------+
| TRIGGER                          | Required to run the CREATE TRIGGER,     |
|                                  | DROP TRIGGER, and SHOW CREATE TRIGGER   |
|                                  | statements. When another user           |
|                                  | activates a trigger (running INSERT,    |
|                                  | UPDATE, or DELETE statements on the     |
|                                  | associated table), for the trigger to   |
|                                  | execute, the user that defined the      |
|                                  | trigger should have the TRIGGER         |
|                                  | privilege for the table. The user       |
|                                  | running the INSERT, UPDATE, or DELETE   |
|                                  | statements on the table is not          |
|                                  | required to have the TRIGGER privilege. |
+----------------------------------+-----------------------------------------+
| UPDATE                           | Update existing rows in a table using   |
|                                  | the UPDATE statement. UPDATE            |
|                                  | statements usually include a WHERE      |
|                                  | clause to update only certain rows.     |
|                                  | You must have SELECT privileges on the  |
|                                  | table or the appropriate columns for    |
|                                  | the WHERE clause. The UPDATE privilege  |
|                                  | can also be set on individual columns;  |
|                                  | see Column Privileges below for         |
|                                  | details.                                |
+----------------------------------+-----------------------------------------+

Column Privileges
-----------------

Some table privileges can be set for individual columns of a table. To use
column privileges, specify the table explicitly and provide a list of column
names after the privilege type. For example, the following statement would
allow the user to read the names and positions of employees, but not other
information from the same table, such as salaries.

GRANT SELECT (name, position) on Employee to 'jeffrey'@'localhost';

+----------------------------------+-----------------------------------------+
| Privilege                        | Description                             |
+----------------------------------+-----------------------------------------+
| INSERT (column_list)             | Add rows specifying values in columns   |
|                                  | using the INSERT statement. If you      |
|                                  | only have column-level INSERT           |
|                                  | privileges, you must specify the        |
|                                  | columns you are setting in the INSERT   |
|                                  | statement. All other columns will be    |
|                                  | set to their default values, or NULL.   |