Solved

Move MySQL database from Windows to Linux

Posted on 2003-10-22
4
1,288 Views
Last Modified: 2008-03-04
How shall I move a MySQL database from Win2K to Linux-RH9.  Never done it and haven't seen 'the' recommended method.

Windows2000 - MySQL 4.0.15 - phpMyAdmin 2.5.3
Linux RH9 - MySQL 3.23.58 - phpMyAdmin 2.5.3
0
Comment
Question by:speyfisher
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Squeebee earned 250 total points
ID: 9602762
Here is how I do it:

from the bin directory under the mysql directory, on a command line:

mysqldump -u <username> -p<password> --quick <databasename> | mysql -h <redhatIP> -u <redhatuser> -p<redhatpassword> <databasename>

You will need to have already created the database on teh RH box, but not the tables. Note that there is no space between -p and the password, if your password is 12345 this would be -p12345.

This will dump the tables across the network. In theory the tables are portable but why bother with potential problems?

Note that under Linux table names are CaSe SenSitIvE, unlike in Windows.
0
 
LVL 4

Author Comment

by:speyfisher
ID: 9604819
Great--  I moved all my databases over my network to RH9 without a hitch.  

If I could not use this method over a network, would you illustrate how I'd install a dump ... a .sql  or  .gz for example on the Linux machine?
0
 
LVL 17

Expert Comment

by:Squeebee
ID: 9606236
On Windows:

mysqldump -u <username> -p<password> --quick <databasename> > dump.sql

Move dump.sql to Linux machine.

On Linux:

mysql -u <redhatuser> -p<redhatpassword> <databasename> < dump.sql

Just introduces a file as the middleman is all.
0
 
LVL 4

Author Comment

by:speyfisher
ID: 9608734
thanks!
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikipedia.org/wiki/PHP  Very powerful.  But a…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question