• +91 9723535972
  • info@interviewmaterial.com

My SQL Interview Questions and Answers

Question - Access Control, Stage 2: Request Verification?

Answer - Once you establish a connection, the server enters Stage 2. For each request that comes in on the connection, the server checks whether you have sufficient privileges to perform it, based on the type of operation you wish to perform. This is where the privilege fields in the grant tables come into play. These privileges can come from any of the user, db, host, tables_priv, or columns_priv tables. The grant tables are manipulated with GRANT and REVOKE commands. The user table grants privileges that are assigned to you on a global basis and that apply no matter what the current database is. For example, if the user table grants you the delete privilege, you can delete rows from any database on the server host! In other words, user table privileges are superuser privileges. It is wise to grant privileges in the user table only to superusers such as server or database administrators. For other users, you should leave the privileges in the user table set to 'N' and grant privileges on a database-specific basis only, using the db and host tables. The db and host tables grant database-specific privileges. Values in the scope fields may be specified as follows: The wild-card characters `%' and `_' can be used in the Host and Db fields of either table. A '%' Host value in the db table means ``any host.'' A blank Host value in the db table means ``consult the host table for further information.'' A '%' or blank Host value in the host table means ``any host.'' A '%' or blank Db value in either table means ``any database.'' A blank User value in either table matches the anonymous user. The db and host tables are read in and sorted when the server starts up (at the same time that it reads the user table). The db table is sorted on the Host, Db, and User scope fields, and the host table is sorted on the Host and Db scope fields. As with the user table, sorting puts the most-specific values first and least-specific values last, and when the server looks for matching entries, it uses the first match that it finds. The tables_priv and columns_priv tables grant table- and column-specific privileges. Values in the scope fields may be specified as follows: The wild-card characters `%' and `_' can be used in the Host field of either table. A '%' or blank Host value in either table means ``any host.'' The Db, Table_na

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners