MySQL database backup(dump) and restore Backup(aka dump): Using mysqldump to copy a database named test to a text file on e: 1. Change to a directory with the mysqldump utility(or set a path) cd e:\xampp\mysql\bin 2. Execute the mysqldump program to copy the test database to a text file(test.sql): E:\xampp\mysql\bin> mysqldump -u yourUsername -p test > e:\test.sql Restore(to copy a file of sql commands and data into a MySQL database): E:\xampp\mysql\bin> mysql -u yourUsername -p test < e:\test.sql Notes: 1. This example applies to MySQL that is part of an xampp stack stored on a usb and resides on a device lettered e. 2. If restoring to a different copy of xampp, first login as root to create a database and grant user privileges (otherwise the database and username will be unknown). 3. Consult a MySQL reference. There are many useful options and variations on the way mysqldump is used here.