How to Backup and Restore MySQL Databases

How to Backup and Restore MySQL Databases

Help us continue creating free content like this…

       

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



Don’t forget to subscribe on YouTube



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