4

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

0

5 Answers 5

7

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: http://www.chriscalender.com/?p=28=1

I Hope this helps.

2
  • +1 for the MyISAM copy method
    – o.k.w
    Dec 20, 2009 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. Jul 2, 2012 at 13:24
2

You can back up from your Mysql in windows and restore this in Linux . see this :
http://www.devshed.com/c/a/MySQL/Backing-up-and-restoring-your-MySQL-Database/

2

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.

0

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.

-2

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

You must log in to answer this question.