How to restore mysql database backup from command line

You  can restore database backup by typing following commands from command line.

Go to run dialog by pressing Window + R keys at the same time.

Type following command and press Enter key.

I assumed you have created an empty database first

mysql -u <database username> -p <database name> < database_backup_file_name.sql

This command will ask you to enter database password. Enter password and press Enter key.

Your database will be restored.

That’s it!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s