Question: In this exercise, you back up a database to create a backup script file. Then, you make some changes to the database and delete it

In this exercise, you back up a database to create a backup script file. Then, you make some changes to the database and delete it. Finally, you restore the database from the backup script and the binary log file.
Back up a database
1. If it isnt already enabled, enable binary logging as described in chapter 17.
2. Start a command prompt and use the mysqldump program to create a full backup of the AP database. This backup should include the structure and data for the database, as well as any stored routines, functions, and events for the database. After the dump, leave the command prompt open.
3. Start MySQL Workbench and open the backup script that was created by the mysqldump program. Make sure that this script contains all the SQL statements needed to restore the structure and data of the database. If necessary, add the CREATE DATABASE statement that creates the AP database and the USE state-ment that selects it.
4. Use MySQL Workbench to execute an INSERT statement that inserts one row into the Vendors table of the AP database, and note the time on your computer that this statement is executed.
5. Wait until the time on your computer changes to at least the next minute. Then, use MySQL Workbench to delete the row you just added.
Restore a database
6. Switch back to the command prompt and use the mysql program to run the backup script. This should restore the entire AP database.
7. Identify the highest numbered file for the binary log. Then, switch back to the command prompt and use the mysqlbinlog program to add the row to the Vendors table that you inserted in step 4. To do that, youll need to include start and end times that include the INSERT statement but omit the DELETE statement you executed in step 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!