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

Which is the fastest way to transfer mysql databases from xampp on Windows to a MySql server on Ubuntu?

share|improve this question

closed as off-topic by Tom O'Connor Aug 14 '13 at 21:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Tom O'Connor
If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

Xampp comes packaged with PhpMyAdmin, if memory serves. Use that web interface to export your database tables in .sql format.

pma screenshot

If you have PhpMyAdmin on the Ubuntu machine as well, you can use that to import the exported .sql file there.

If you don't, you can do the import from the command line.

Create an empty database on the Ubuntu machine with: mysql -u username -p -e "CREATE DATABASE databasenamehere;

After that, you can import the .sql file you made earlier using mysql -u username -p databasenamehere < databasedump.sql

Thanks to xofer for the comment below, I updated my answer.

share|improve this answer
1  
+1 If you have phpMyAdmin installed on the Ubuntu box, and the exported file size is not too big (use zip compression when you export) you can use the import tab. Either way though, you need to create an empty database first. From the command line (before running the mysql command in kenny.r's answer) run mysql -u USER -p -e "CREATE DATABASE upgrade_wordpress;" –  xofer Sep 12 '11 at 18:40
    
Ok Maybe I've explained it wrong. I already know how to export and import the databases from phpMyAdmin. What I want is to bypass this method. Is it possible? –  albertopriore Sep 13 '11 at 21:14
    
What I want to know is that If I have the directory in windows \xampp\mysql\data is it possible to use the same directory under a Ubuntu machine (I've the Ubuntu machine in Virtualbox under Windows XP). –  albertopriore Sep 14 '11 at 8:42

from the command line:

mysqldump -u username -p password database_name > database_name.sql

then copy the .sql to the ubuntu server and then:

mysql -u username -p password database_name < database_name.sql
share|improve this answer

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