Solved

Move MySQL database from Windows to Linux

Posted on 2003-10-22
4
1,285 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now