Learning Mysql


Managing Privileges with SQL | 339



Download 4.24 Mb.
View original pdf
Page313/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   309   310   311   312   313   314   315   316   ...   366
Learning MySQL
Managing Privileges with SQL | 339

respectively—and other values associated with the user we explain the other parameters that can beset for users later.
Let’s consider an example. Suppose you issue the statement:
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON *.*
-> TO 'fred'@'localhost' IDENTIFIED BY '4fgh6!aa';
Query OK, 0 rows affected (0.19 sec)
This creates a row in the User table of the mysql database. Select this database, and list the table rows for fred
; here’s the output, modified so that it fits on this page:
mysql> USE mysql
Database changed mysql> SELECT * FROM user WHERE User = 'fred';
+-----------+------+-------------------------------------------+-------------+...
| Host | User | Password | Select_priv |...
+-----------+------+-------------------------------------------+-------------+...
| localhost | fred | *8325B39F81993E24AC6802CD33722DB8B1D64C21 | Y |...
+-----------+------+-------------------------------------------+-------------+...
...+-------------+-------------+-------------+-------------+-----------+...
...| Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv |...
...+-------------+-------------+-------------+-------------+-----------+...
...| Y | Y | Y | N | N |...
...+-------------+-------------+-------------+-------------+-----------+...
...+-------------+---------------+--------------+-----------+------------+...
...| Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv |...
...+-------------+---------------+--------------+-----------+------------+...
...| N | N | N | N | N |...
...+-------------+---------------+--------------+-----------+------------+...
...+-----------------+------------+------------+--------------+------------+...
...| References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv |...
...+-----------------+------------+------------+--------------+------------+...
...| N | N | N | N | N |...
...+-----------------+------------+------------+--------------+------------+...
...+-----------------------+------------------+--------------+...
...| Create_tmp_table_priv | Lock_tables_priv | Execute_priv |...
...+-----------------------+------------------+--------------+...
...| NY N |...
...+-----------------------+------------------+--------------+...
...+-----------------+------------------+------------------+----------------+...
...| Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv |...
...+-----------------+------------------+------------------+----------------+...
...| N | N | N | N |...
...+-----------------+------------------+------------------+----------------+...
...+---------------------+--------------------+------------------+----------+...
...| Create_routine_priv | Alter_routine_priv | Create_user_priv | ssl_type |...
...+---------------------+--------------------+------------------+----------+...
...| N | N | N | |...
...+---------------------+--------------------+------------------+----------+...
...+------------+-------------+--------------+---------------+-------------+...
...| ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates |...
...+------------+-------------+--------------+---------------+-------------+...
...| | | | 0 | 0 |...
...+------------+-------------+--------------+---------------+-------------+...
...+-----------------+----------------------+

Download 4.24 Mb.

Share with your friends:
1   ...   309   310   311   312   313   314   315   316   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page