How to backup/restore data in mysql database very quickly?
Asked
Active
Viewed 469 times
0
-
I need this to switch between test data and live, have to do this several times so need fast solution. Thanks. – Steve Feb 10 '11 at 11:29
2 Answers
1
mysqldump
command line is the quickest to backup ,
(use mysql command line to restore , mysql -u #username# -p #database# < #dump_file#
)
look on this examples

Haim Evgi
- 123,187
- 45
- 217
- 223
-
great, will try in batch file, hopefully using same batch file, it 'll have no issue on windows and linux. – Steve Feb 10 '11 at 11:35
1
Following will backup and restore db at same time.
mysqldump -h #host -u #username -p #password --routines #source_dbname | mysql -h #host -u #user -p #password #destination_dbname

Krunal
- 2,061
- 3
- 13
- 13