List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:June 4 1999 8:35pm
Subject:Re: move db to another disk
View as plain text  
DongYu Wang wrote:
> 
> Hi,
> 
> I am running mySQL3.21 under Linux RH5.2
> 
> I just added another hard disk to the system and want to move my MySQL
> database files to the newly added hard disk.
> 
> Could anybody tell me how to do that.
> 
> I checked the system and could not find my.cnf file.
> 
> Thanks in advance
> 
> DWang

The most painless way to do this would be something like
this ( I make the assumption that your MYSQL_BASE is
/usr/local/mysql, data is in /usr/local/mysql/data and
the device file name for your second drive is /dev/sdb:

$mysqladmin -uroot -pBigSecret shutdown
$su
#mkfs.ext2 /dev/sdb
#mount /dev/sdb /mnt/misc
#mv /usr/local/mysql/data /mnt/misc/
#mkdir /usr/local/mysql/data
#umount /dev/sdb
#mount /dev/sdb /usr/local/mysql/data
#exit
$mysql.server start

And that should do it. Make sure that you understand all
the commands, do not just execute them in the "cookbook
mode", otherwise you may ruin an existing filesystem.
Your directories and devices may be different, but you
get the idea.

You may also want to automatically mount /dev/sdb onto
/usr/local/mysql/data from /etc/fstab at boot time

-- 
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
Thread
move db to another diskDongYu Wang5 Jun
  • Re: move db to another diskSasha Pachev5 Jun
  • Re: move db to another diskPaul DuBois5 Jun
  • Re: move db to another diskVan5 Jun
    • Re: move db to another diskPaul DuBois5 Jun
  • Re: move db to another diskVan5 Jun