How to Backup and Restore MySQL Databases

How to Backup and Restore MySQL Databases



Help keep us going…

       

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *