Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm very new to servers and databases, my experience spanning only a few installations of XAMPP for easy website testing and exploration. So I have XAMPP installed on my laptop, and I just put it on my netbook. I copied & moved my htdocs folder (soon to be synced with dropbox), and now need to move the database.

I am not looking for an extensive backup solution. What is the simplest way to copy my db setup on one XAMPP stack to another?

share|improve this question
up vote 4 down vote accepted

The easiest way is probably by using phpMyAdmin, which is installed as part of XAMPP.

To export

In a browser, open


Click on export

Select your database(s) from the list

Tick the save as file box at the bottom of the page.

Click Go

Your database(s) will be exported as an SQL file, which you can use to re-create them on your other machine. Copy this file to your laptop.

To import

In a browser, open


Click on import

Browse to the file you just exported.

Click Go

share|improve this answer

You can use the built-in function of mysql to do this.

If you have direct access to your mysql server by typing mysql into your console you can do some backups.

mysqldump -p databasename > filename_to_store_sql.sql

Copy the .sql file to the new computer/place and do the following.

mysql -p databasename < filename_to_store_sql.sql
share|improve this answer

For export all databases:

mysqldump --all --all-databases --complete-insert --add-drop-table --add-locks --allow-keywords --lock-tables --quote-names --user=root --password=1234 > ~/Desktop/mysql_all_db.sql

For import:

mysql -uroot -p < ~/Desktop/mysql_all_db.sql
share|improve this answer

Another alternative might be to use the MySQL Workbench

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.