Hour 19, Managing Database Security

Team-Fly    

 
Sams Teach Yourself SQL in 24 Hours, Third Edition
By Ronald R. Plew, Ryan K. Stephens
Table of Contents
Appendix C.  Answers to Quizzes and Exercises


Hour 19, "Managing Database Security"

Quiz Answers

1:

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

A1:

GRANT OPTION.

2:

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

A2:

All users of the database will be granted the privileges.

3:

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

A3:

The SELECT privilege.

4:

What type of privilege is SELECT?

A4:

An object-level privilege.

Exercise Answers

1:

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

 USE MYSQL; 
A1:
2:

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

  SHOW TABLES;  
A2:
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.

A3:
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.

A4:
5:

Get a list of all database users by typing:

  SELECT * FROM USER;  
A5:

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