Module 8: Basic Administration and Backups


1.  

What does the following command accomplish?

 GRANT ALL ON monsters.* TO vanhelsing@'%' IDENTIFIED BY "4ber4h4m"; 

2.  

What command allows the new user giles to log in only from the local host using the password fyarl68 and to look up or look at all databases and tables but nothing else?

3.  

What command allows you to remove the ALTER , INDEX , DELETE , and DROP privileges from the user morgan@kelson.org on the swords table of the arsenal database?

4.  

What series of commands removes all of the user privileges of woodchuck@dandd.com and then deletes the user account and wipes it from the system?

5.  

What are the possible privileges that can be removed from a user with the REVOKE command?

6.  

What must you always do before and after using the myisamchk script to avoid further damage to the database?

7.  

What types of backup files are used with the RESTORE command?

8.  

What type of backup file does the mysqldump script produce?

9.  

What command should you use to initially check the tables sandstorms , sandworms , and watercustoms ?

10.  

What command should you use any time your database has had a great deal of changes made or a large amount of data deleted?

Answers

1.  

It creates a user named vanhelsing who can connect from any host to any table in the monsters database and whose password is 4ber4h4m .

2.  

The command is as follows :

 GRANT SELECT, SHOW ON *.* TO giles@localhost INDENTIFIED BY "fyarl68"; 

3.  

The command is as follows:

 REVOKE ALTER, INDEX, DELETE, DROP, ON arsenal.swords FROM morgan@kelson.org; 

4.  

The commands are as follows:

 REVOKE ALL ON *.* FROM woodchuck@dandd.com; DELETE FROM mysql.user WHERE USER="woodchuck" AND HOST= "dandd.com"; FLUSH PRIVILEGES; 

5.  

The privileges that can be removed using the REVOKE command are SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , GRANT OPTION , INDEX , and ALTER .

6.  

You should always issue the LOCK TABLE command before using the myisamchk script and the UNLOCK TABLE command after using it.

7.  

The RESTORE command uses .frm and .MYD files.

8.  

The mysqldump script results in a .sql file.

9.  

The following CHECK TABLE command, with the QUICK option, should be tried first:

 CHECK TABLE sandstorms, sandworms, watercustoms QUICK; 

10.  

You should run the OPTIMIZE TABLE command when a lot of transactions have taken place or when sections of data have been deleted from a table.




MySQL(c) Essential Skills
MySQL: Essential Skills
ISBN: 0072255137
EAN: 2147483647
Year: 2006
Pages: 109

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