Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer MySQL data from Windows to Linux

Status
Not open for further replies.

TheFoxy

Programmer
Nov 22, 2002
48
GB
If a Windows MySQL DB is started, tables created, data put in, etc, can the tables/data etc be moved to a Linux MySQL DB at a later date?
 
Yes. Certainly by a less direct method, possibly by a more direct method.

If you use mysqldump to output the SQL code to reproduce your database, that data created is completely portable.

Since MySQL creates a filesystem directory for every database, and files on the filesystem for every table, you can move data by simply copying those files across. This works between two MySQL systems on two different Linux boxes. I don't know about Win32->Linux.

Want the best answers? Ask the best questions: TANSTAAFL!
 
I just copied all the files from C:\mysql\data into /usr/local/mysql/data, and did [tt]`chown mysql *'[/tt] and [tt]`chgrp mysql[/tt] *'. Flawless as far as I know.

I REALLY hope that helps.
Will
 
Just make sure the server is not running or all the tables are locked when copying or they might end up corrupt. If bandwidth is an issue you do not need move index files, you can rebuild those later.

Check the mysqlhostcopy.pl script, its a great tool for this kind of stuff, it even has some support for scp.

abombss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top