Restore local MySQL database

This is the command to restore a MySQL database.

To restore it on a local computer, follow this process:
1) Open the command line (Windows, Linux or Mac)
2) cd (change directory) to the directory where the mysql.exe is located. This is likely to be in a bin directory. For example, with WAMPserver, mysql.exe is located here:
c:\wamp\bin\mysql\mysql5.0.45\bin
3) Create the database (if you haven't already). You can use phpmyadmin for this if you wish
4) Copy the dump or sql file to the directory located in step 2
5) Run the command in the following snippet

  1. mysql -u<user> -p dbname < db_backup.sql

Enjoy this article?

Get my best content on Javascript, CSS, PHP & Git before anyone else and special bonuses.

Get started

Add new comment