Solution to Activity 15.1
Perform the following steps to achieve the goal of this activity:
- Open Command Prompt.
- Locate and execute the
mysqldump.exe
file. - Create a backup of the
world
schema by writing the following code in Command Prompt:mysqldump -u root -p world > "C:\Users\bhaveshb\Desktop\world_backup.sql"
In the preceding code, you invoked mysqldump
and specified the world
schema as the only schema you want to back up. Depending on your configuration, you may have to use -u
, -p
, and other options to specify the credentials to connect to the database.
- Simulate a disaster. Open the MySQL client and use the
world
database by writing the following code:USE world
- Now, delete all the rows from the
city
table present in theworld
database. This can be done using the following query:DELETE FROM city;
- To check that all the rows have been deleted from the
city
table, use theSELECT
command:SELECT * FROM city;
The preceding code...