Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

4 Answers

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

http://localhost/phpmyadmin

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

http://localhost/phpmyadmin

Click on import

Browse to the file you just exported.

Click Go

share|improve this answer
add comment

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
add comment

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
add comment

Another alternative might be to use the MySQL Workbench

share|improve this answer
add comment

Your Answer

 
discard

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.