MySql – Take/Restore database backup


This post will explain how to take database backup from mysql as well as how to restore database backup to mysql from console using commands.

How to take mysql database dump/backup from console

Open command window. Go to bin directory under your mysql installation. In my case it is C:Program FilesMySQLMySQL Server 5.1bin.

mysqldump.exe --skip-lock-tables -h127.0.0.1 -udbuser -pdbpassword mydatabase > C:db_backupmydatabase_28_11_2013.dump

How to restore mysql database dump/backup from console

Open command window. Go to bin directory under your mysql installation. In my case it is C:Program FilesMySQLMySQL Server 5.1bin.

mysql -udbuser -pdbpassword mydatabase < C:db_backupmydatabase_28_11_2013.dump
This entry was posted in MySQL and tagged .

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>