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

What is the recommended way of moving an MySQL database from Windows (XP) to Linux (Ubuntu 9.10)?

I am thinking running mysqldump from XP then import on the Linux box - is there a better way?

Has anyone done this before, and if yes, could they please outline the steps required.

[Edit] Should have added this: I am using mySQL v5.1 and I am using InnoDb format

share|improve this question

migrated from Dec 21 '09 at 4:26

This question came from our site for professional and enthusiast programmers.

The mysqldump approach will certainly work, and the result will be reliable. This is the way I would recommend, unless you have very good reasons not to do it like this.

Now, for MyISAM tables you should be able to simply copy the .FRM, .MYI and .MYD files to the appropriate directory corresponding to the target database (MySQL creates a dir corresponding to each database in the data directory)

For InnoDB tables, simply copying the files does not work. I have seen people do it though, for example, see this article:

I Hope this helps.

share|improve this answer
+1 for the MyISAM copy method – o.k.w Dec 20 '09 at 10:05
Yep, I have used the mysqldump command to move DBs between NT and *nix environments before, works like a champ. Only ever had one problem before and that was related to line endings in the file, I blame that on my text editor. – Brent Pabst Jul 2 '12 at 13:24

You can back up from your Mysql in windows and restore this in Linux . see this :

share|improve this answer

You're on the right track. dump and load is the best and most reliable way. Any other method may result in problems, which may not always be immediately evident.

share|improve this answer

If possible, copying the data files will be the fastest option. Since you won't need to reinsert data or rebuild indexes. Just be sure to take the relevant backups just in case, which may include a mysqldump, before you begin.

You can copy data files from both MyISAM and InnoDB between architectures providing they use the same floating-point format. It's foremost documented here for MyISAM and here for InnoDB. You might also be interested in this thread which asserts specifically that there are no expected format issues when moving between Windows and Ubuntu as a platform. It also includes some useful advice on the procedure.

In relation to Roland's answer, copying or moving InnoDB data is possible and supported. You simply have to be a bit more careful of all the relevant settings. In much the same way that InnoDB will fail to start if you change the data and log size options on whim.

share|improve this answer

you need to use the 12.04 linux ubuntu and update using update manager.. then install the microsoft windows compatibility wine by simply searching it to ubuntu software update then add the database by adding odbcadd32 in terminal

share|improve this answer

Your Answer


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