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:
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

Conquer Drupal 8 Module Development

Don't struggle to conquer Drupal 8 module development. Action packed lessons where you will work along building your own real world modules.

20% launch discount available now!

Find out more

Add new comment