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