Solution to Question 8-1
The mysql command provides an interactive interface to MySQL.
Solution to Question 8-2
To back up a database called "blog" from the command line, execute:
mysqldump -u root -p blog > my_backup.sql
A password prompt appears before the backup begins.
Solution to Question 8-3
To restore the "blog" backup file from the command line, execute:
mysql -u root -p -D test < my_backup.sql
A password prompt appears before the restore begins.
Solution to Question 8-4
The advantages for creating an index are:
Queries with where clauses that match the index columns are much faster.
Verifying the uniqueness of an index value is much faster.
Some disadvantages are:
Queries that insert or remove rows from an indexed table take longer for the index to update.
Additional storage space is required to store the index.