How to Backup and Restore MySQL Databases

How to Backup and Restore MySQL Databases

This video shows how to backup and restore a MySQL database from the command line





1.) If you need to reference the database name, open the MySQL Command Line Client and type – show databases;

2.) Open the Windows command prompt and navigate to the MySQL installation folder that contacts the following executable files:
      – mysqldump.exe
      – mysql.exe

3.) To backup the database, type the following – mysqldump -u username -p databasename > path\backupfilename.sql

4.) To restore the database, type the following – mysql -u username -p databasename < path\backupfilename.sql
      Note: If the database you are restoring no longer exists, you need to recreate it by typing the following into the MySQL Command Line – create database databasename;

5.) To confirm, open the MySQL Command Line Client and type – use databasename, and then type – show tables;

6.) Confirm that the tables match up




Did you find this page helpful?

PID: 20180503-00001