Workshop

Team-Fly    

 
Sams Teach Yourself SQL in 24 Hours, Third Edition
By Ronald R. Plew, Ryan K. Stephens
Table of Contents
Hour  19.  Managing Database Security


The following workshop is composed of a series of quiz questions and practical exercises. The quiz questions are designed to test your overall understanding of the current material. The practical exercises are intended to afford you the opportunity to apply the concepts discussed during the current hour, as well as build upon the knowledge acquired in previous hours of study. Please take time to complete the quiz questions and exercises before continuing. Refer to Appendix C,"Answers to Quizzes and Exercises," for answers.

Quiz

1:

What option must a user have to grant another user privileges on an object not owned by the user ?

2:

When privileges are granted to PUBLIC, do all database users acquire the privileges, or only specified users?

3:

What privilege is required to look at data in a specific table?

4:

What type of privilege is SELECT?

Exercises

1:

Log in to MySQL and type the following at the mysql> prompt to use the default mysql database:

 USE MYSQL; 
2:

Type the following at the mysql> prompt to get a list of the default tables:

  SHOW TABLES;  
3:

Now, describe each one of the following tables as follows :

 DESCRIBE COLUMNS_PRIV;  dESCRIBE DB; dESCRIBE HOST; dESCRIBE TABLES_PRIV; dESCRIBE USER; 

Each of these tables relates to database security in MySQL.

4:

Create a new database user as follows:

 GRANT USAGE ON *.* TO 'STEVE@LOCALHOST' IDENTIFIED BY 'STEVE123'; 

Although a user called "STEVE" has been created in the MySQL database, this new user account is not useful unless there is a user called "STEVE" at the operating system level (for example, in Windows or Linux). Logins are important for multiple user environments, such as Linux.

5:

Get a list of all database users by typing:

  SELECT * FROM USER;  

Team-Fly    
Top
 


Sams Teach Yourself SQL in 24 Hours
Sams Teach Yourself SQL in 24 Hours (5th Edition) (Sams Teach Yourself -- Hours)
ISBN: 0672335417
EAN: 2147483647
Year: 2002
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net