Oct 8, 2006
8
0
151
Hello Guys.... Hope we're all doing well. Well here's my coffee cup question for hte morning.


It seems that my mysql databases are storing in the

/var/lib/mysql folder rather then in some off sub diretory of the user partitions in the /home.


Is there a way I can get the mysql database to actually store the datbase in the /home folder...


My problem is my /var partition is 10gigs and thats fine... but some of my users are creating large databases that need to be stored on the much larger user parition of /home which is 350 gig... So that would be outstanding....

Any suggestions on how to move them over....
 

jsnape

Well-Known Member
Mar 11, 2002
174
0
316
Symlink? But pretty sure that doesn't work well if at all with mysql.

maybe -
If there is a backup drive put the files into home temporarily, partition the backup drive adding a second partition, name that /var2 in fstab - create a directory /var2 mount the partition copy the files from /var :


shut off mysql & make it so it wont start back up with chkservd

cd /
cp -br var/* var2

fix the names, unmount /var rename /var2 in fstab

start mysql and watch the error log

(untested commands BTW)

I've had the same problem but it was already time to upgrade the whole box with a fresh install and larger partions. I did a temp fix by getting other things out of that partition whichj bought me a few months.


du -s -B 1024K /var/* |sort -n

and symlink the larger folders (other than /var/lib)
 
Last edited: