DongYu Wang wrote:
> 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
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
#mount /dev/sdb /mnt/misc
#mv /usr/local/mysql/data /mnt/misc/
#mount /dev/sdb /usr/local/mysql/data
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