Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Moving a MySQL installation?



Don Levey wrote:
> I'm upgrading a home machine, which in practice involves simply building 
> a new machine and moving things over to the bigger, faster box.  Not 
> being much of a MySQL person, but using it as the back end of a number 
> of things (Gallery2, Amarok, and others), I find myself needing to move 
> the old data to the new machine or recreate it.  I envision three 
> possibilities, in decreasing levels of desirability:

I'm of the opinion that the path of least resistance is often a greased 
skid to disaster.  So option 1 is not the one I would try at all, 
although in theory (if the MySQL setups are identical - 
version/features/and who knows what else) you ought to be fine.

My preference would be your option 2 which can be done in a single 
statement to export each database and a single statement to import each 
database:

mysqldump -u USER -p  DATABASE > wholedb.sql

	You will be prompted to enter the password for USER

then to restore into a new mysql database

mysql -u USER -p DATABASE < wholedb.sql

	You'll be prompted to enter the password for USER.

Replace USER and DATABASE with appropriate names.

Before discarding the source MySQL installation I'd be certain that 
everything is intact on the new one.

Also, make certain your fresh MySQL installation has at least been 
initialized before you try to import.

/m

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org