Another method to check current privileges is to use SQL to explore the mysql database that manages the privileges. If you’re
experienced with SQL, this is
perhaps the easiest approach, and it’s the one we usually use. We describe this approach later in “Managing
Privileges with SQL.”
mysqlaccessTo quickly see what level of access a particular user
has fora particular database, you can use the mysqlaccess script from a terminal or command prompt. Let’s see what level of access the user partmusic has for the database music. We’ll need to specify the
MySQL superuser name (root) and password
to access the information mysqlaccess --user=root --password=the_mysql_root_password partmusic musicmysqlaccess Version 2.06, 20
Dec By RUG-AIV, by Yves Carlier (Yves.Carlier@rug.ac.be)
Changes by Steve Harvey (sgh@vex.net)
This software comes with ABSOLUTELY NO WARRANTY.
Access-rights for USER 'partmusic', from HOST 'localhost', to DB 'music+ +----------------------+---+
| Select_priv | N | | Lock_tables_priv | N |
| Insert_priv | N | | Execute_priv | N |
| Update_priv | N | | Repl_slave_priv | N |
| Delete_priv | N | | Repl_client_priv | N |
| Create_priv | N | | Create_view_priv | N |
| Drop_priv | N | | Show_view_priv | N |
| Reload_priv | N | | Create_routine_priv | N |
| Shutdown_priv | N | | Alter_routine_priv | N |
| Process_priv | N | | Create_user_priv | N |
| File_priv | N | | Ssl_type | ? |
| Grant_priv | N | | Ssl_cipher | ? |
| References_priv | N | | X509_issuer | ? |
| Index_priv | N | | X509_subject | ? |
| Alter_priv | N | | Max_questions | 0 |
| Show_db_priv | N | | Max_updates | 0 |
| Super_priv | N | | Max_connections | 0 |
| Create_tmp_table_priv | N | | Max_user_connections | 0 |
+-----------------------+---+ +NOTE A password is required for user `partmusic' The following rules are used:
db : 'No matching rule'
host : 'Not processed host-field is not empty in db-table.'
user : 'localhost','partmusic','652f9c175d1914f9',
'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N',
'N','N','N','N','N','N','N','N','N','','','','','0','0','0','0'
BUGs can be reported by email to bugs@mysql.com
If you specify the wildcard character 'in
place of music, the access privileges for all databases will be shown.
Similarly, you can specify the wildcard character 'in place
Share with your friends: