change mysql dir?

malachor

Verified User
Joined
Apr 15, 2005
Messages
35
Location
Seattle, WA
quick question...
what exactly does this do?
Code:
cd /home 
mkdir mysql 
chown mysql:mysql mysql 
cd mysql 
/sbin/service mysqld stop 
cp -Rp /var/lib/mysql/* . 
cd /var/lib 
mv mysql mysql_old 
ln -s /home/mysql ./mysql 
/sbin/service mysqld start 

#once satisfied that mysqld is running, remove the old data: 

rm -rf mysql_old

I just setup a second drive as home2 and if i change this slightly i can have it relocate mysql dir, and make more space... would it look like;
Code:
cd /home2
mkdir mysql 
chown mysql:mysql mysql 
cd mysql
/sbin/service mysqld stop 
cp -Rp /var/lib/mysql/* . 
cd /var/lib 
mv mysql mysql_old 
ln -s /home2/mysql ./mysql 
/sbin/service mysqld start 

#once satisfied that mysqld is running, remove the old data: 

rm -rf mysql_old

I think this would be right because my new drive is "home2"
 
Is this how one would go about having mysql on a seperate drive? Looking at adding another drive just for mysql and was wanting to know how to do it in DA.
 
Back
Top