Backing up and restoring data from MySQL databases
Link to this page use http://www.markfennell.com/kb.php?id=000084
To back up a mySQL database. Enter Telnet (or SSH)
mysqldump --user root --password=****** mt > /home/web/db/sql.dump
This example is for the backup of the moveableType Database (database name mt) from my web server onto my local server. Above command creates a text file sql.dump. Make sure you put your own path and password in if any.
Importing
Enter MySQL
mysql -u root -p
->drop database mt;
->create database mt;
The above command deletes ALL the existing data in database mt. I recommend making a backup first!
Exit MySQL
then at prompt
mysql -p -u root --database=mt < /home/web/db/sql.dump
Added: December 01, 2003
|